-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbio-engine.spec
More file actions
146 lines (133 loc) · 3.91 KB
/
bio-engine.spec
File metadata and controls
146 lines (133 loc) · 3.91 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
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_all, collect_submodules
import sys
import os
import site
# Get the environment prefix dynamically
conda_prefix = sys.prefix
# Get the actual site-packages directory
site_packages = site.getsitepackages()
print(f"INFO: sys.prefix = {sys.prefix}")
print(f"INFO: site-packages = {site_packages}")
datas = []
binaries = []
# Tracy will be handled by Tauri, not bundled here
# Optionally include these shared libraries only if they exist (Linux/Conda specific fixes)
for lib in ['libcrypto.so.3', 'libssl.so.3']:
lib_path = os.path.join(conda_prefix, 'lib', lib)
if os.path.exists(lib_path):
binaries.append((lib_path, '.'))
# Verify that critical packages can be imported before proceeding
import importlib
for pkg in ['uvicorn', 'fastapi', 'h11', 'starlette']:
try:
mod = importlib.import_module(pkg)
print(f"INFO: {pkg} found at {mod.__file__}")
except ImportError as e:
print(f"ERROR: {pkg} NOT FOUND: {e}")
hiddenimports = [
'fastapi',
'uvicorn',
'uvicorn.logging',
'uvicorn.loops',
'uvicorn.loops.auto',
'uvicorn.protocols',
'uvicorn.protocols.http',
'uvicorn.protocols.http.auto',
'uvicorn.protocols.http.httptools_impl',
'uvicorn.protocols.http.h11_impl',
'uvicorn.protocols.websockets',
'uvicorn.protocols.websockets.auto',
'uvicorn.protocols.websockets.websockets_impl',
'uvicorn.lifespan',
'uvicorn.lifespan.on',
'uvicorn.lifespan.off',
'uvicorn.config',
'uvicorn.main',
'uvicorn.server',
'uvicorn._types',
'h11',
'h11._connection',
'h11._events',
'h11._state',
'h11._readers',
'h11._writers',
'h11._util',
'h11._abnf',
'h11._headers',
'h11._receivebuffer',
'click',
'anyio',
'anyio._backends',
'anyio._backends._asyncio',
'sniffio',
'starlette',
'starlette.routing',
'starlette.responses',
'starlette.requests',
'starlette.middleware',
'starlette.middleware.cors',
'psycopg2',
'pkg_resources'
]
# Collect all submodules explicitly for critical packages
for pkg in ['uvicorn', 'fastapi', 'starlette', 'h11', 'anyio']:
try:
submods = collect_submodules(pkg)
hiddenimports += submods
print(f"INFO: Collected {len(submods)} submodules for {pkg}")
except Exception as e:
print(f"WARNING: Could not collect submodules for {pkg}: {e}")
# Collect all dependencies (data, binaries, and hidden imports)
packages_to_collect = [
'fastapi', 'uvicorn', 'h11', 'click', 'anyio', 'sniffio', 'starlette',
'Bio', 'hgvs', 'ometa', 'parsley', 'terml',
'psycopg2', 'bioutils', 'pkg_resources', 'httpx', 'pysam', 'redis'
]
for package in packages_to_collect:
try:
tmp_ret = collect_all(package)
datas += tmp_ret[0]
binaries += tmp_ret[1]
hiddenimports += tmp_ret[2]
print(f"INFO: collect_all({package}) -> {len(tmp_ret[0])} datas, {len(tmp_ret[1])} binaries, {len(tmp_ret[2])} hiddenimports")
except Exception as e:
print(f"WARNING: Could not collect {package}: {e}")
# Build search paths: include site-packages so PyInstaller can find all installed modules
pathex = ['.']
pathex += site_packages
pathex.append(os.path.join(conda_prefix, 'lib'))
a = Analysis(
['main.py'],
pathex=pathex,
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='bio-engine',
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,
)