-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyQuantLab.spec
More file actions
148 lines (136 loc) · 3.9 KB
/
Copy pathPyQuantLab.spec
File metadata and controls
148 lines (136 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec for PyQuantLab."""
import os
from pathlib import Path
import site
import streamlit
# Use SPECPATH (provided by PyInstaller) as the project root
PROJECT_DIR = SPECPATH # noqa: F821
# Get streamlit's installed path for bundled assets
streamlit_dir = Path(streamlit.__file__).parent
site_packages = Path(site.getsitepackages()[0])
# Collect all necessary data files
added_files = [
(os.path.join(PROJECT_DIR, 'app.py'), '.'),
(os.path.join(PROJECT_DIR, 'config.py'), '.'),
]
# Add package metadata (.dist-info) for importlib.metadata
for pkg_name in ['streamlit', 'altair', 'pandas', 'numpy', 'plotly', 'scipy', 'yfinance',
'jinja2', 'tornado', 'pydeck', 'pillow', 'requests', 'urllib3',
'certifi', 'idna', 'charset_normalizer', 'rich', 'click', 'gitpython',
'gitdb', 'smmap', 'watchdog', 'cachetools', 'protobuf',
'markdown_it_py', 'mdurl', 'pygments', 'blinker', 'validators']:
dist_info = site_packages / f'{pkg_name}-*.dist-info'
for match in site_packages.glob(f'{pkg_name}-*.dist-info'):
added_files.append((str(match), match.name))
# Add all project modules
for root, dirs, files in os.walk(PROJECT_DIR):
for f in files:
if f.endswith('.py') and f not in ['launcher.py', 'PyQuantLab.spec']:
if '__pycache__' in root:
continue
full = os.path.join(root, f)
rel_dir = os.path.relpath(os.path.dirname(full), PROJECT_DIR)
added_files.append((full, rel_dir))
# Streamlit's built-in frontend assets
streamlit_static = streamlit_dir / 'static'
if streamlit_static.exists():
added_files.append((str(streamlit_static), 'streamlit/static'))
a = Analysis(
['launcher.py'],
pathex=[],
binaries=[],
datas=added_files,
hiddenimports=[
# Streamlit internals
'streamlit',
'streamlit.web',
'streamlit.web.bootstrap',
'streamlit.web.server',
'streamlit.web.server.websocket_headers',
'streamlit.runtime',
'streamlit.runtime.scriptrunner',
'streamlit.runtime.state',
'streamlit.runtime.caching',
'streamlit.commands',
'streamlit.elements',
'streamlit.proto',
'streamlit.watcher',
'streamlit.config',
# Plotly
'plotly',
'plotly.express',
'plotly.graph_objects',
'plotly.io',
'plotly.validators',
# yfinance
'yfinance',
'yfinance.ticker',
'yfinance.utils',
# pandas / numpy
'pandas',
'pandas._libs',
'numpy',
'numpy.core',
'numpy.linalg',
'numpy.random',
# scipy
'scipy',
'scipy.optimize',
'scipy.optimize._minimize',
'scipy.linalg',
# Others
'tornado',
'tornado.web',
'tornado.websocket',
'jinja2',
'altair',
'pydeck',
'PIL',
# PyInstaller hooks
'streamlit.web.server.server',
'pkg_resources.py2_warn',
'pkg_resources.markers',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[os.path.join(PROJECT_DIR, 'runtime_hook.py')],
excludes=[
'tkinter',
'matplotlib',
'IPython',
'jupyter',
'notebook',
'sqlalchemy',
'scipy.stats._stats_mstats_common',
],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
a.zipfiles,
name='PyQuantLab',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='PyQuantLab',
)