TIL! Using the existence of obscure member sys._MEIPASS, I can detect if we're running from a bundled PyInstaller binary, versus running from Python directly. Add schema.yaml to the datas of the PyInstaller spec. Then, if the -/--schema flag is given, use it, and if it's not given, default to the built-in one if we're running from a bundled binary, or fall-through to ./schema.yaml in other cases. This avoids the need for config/schema.py as a carbon-copy of the schema, slick!
43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
# -*- mode: python ; coding: utf-8 -*-
|
|
|
|
|
|
block_cipher = None
|
|
|
|
|
|
added_files = [ ( 'schema.yaml', '.') ]
|
|
|
|
a = Analysis(['vppcfg'],
|
|
pathex=['/home/pim/src/vppcfg'],
|
|
binaries=[],
|
|
datas=added_files,
|
|
hiddenimports=[],
|
|
hookspath=[],
|
|
hooksconfig={},
|
|
runtime_hooks=[],
|
|
excludes=[],
|
|
win_no_prefer_redirects=False,
|
|
win_private_assemblies=False,
|
|
cipher=block_cipher,
|
|
noarchive=False)
|
|
pyz = PYZ(a.pure, a.zipped_data,
|
|
cipher=block_cipher)
|
|
|
|
exe = EXE(pyz,
|
|
a.scripts,
|
|
a.binaries,
|
|
a.zipfiles,
|
|
a.datas,
|
|
[],
|
|
name='vppcfg',
|
|
debug=False,
|
|
bootloader_ignore_signals=False,
|
|
strip=False,
|
|
upx=True,
|
|
upx_exclude=[],
|
|
runtime_tmpdir=None,
|
|
console=True,
|
|
disable_windowed_traceback=False,
|
|
target_arch=None,
|
|
codesign_identity=None,
|
|
entitlements_file=None )
|