Files
overcode/overcode.spec

79 lines
1.8 KiB
Python

# -*- mode: python ; coding: utf-8 -*-
"""
OverCode Shell PyInstaller Specification
Creates a standalone executable with all dependencies
"""
import sys
from pathlib import Path
block_cipher = None
# Application data files
added_files = [
('commands', 'commands'),
('utils', 'utils'),
('requirements.txt', '.'),
('README.md', '.') if Path('README.md').exists() else None,
]
# Add pyfiglet fonts
try:
import pyfiglet
pyfiglet_path = Path(pyfiglet.__file__).parent
fonts_path = pyfiglet_path / 'fonts'
if fonts_path.exists():
added_files.append((str(fonts_path), 'pyfiglet/fonts'))
except ImportError:
pass
# Remove None entries
added_files = [item for item in added_files if item is not None]
a = Analysis(
['overshell.py'],
pathex=[],
binaries=[],
datas=added_files,
hiddenimports=[
'colorama',
'pyfiglet',
'pypresence',
'pyreadline3',
'requests'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['tkinter', 'matplotlib', 'numpy', 'pandas'], # Exclude heavy unused modules
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='OverCodeShell',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='overcode_icon.ico' if Path('overcode_icon.ico').exists() else None,
version='version_info.txt' if Path('version_info.txt').exists() else None,
)