Repository navigation
Expand file tree
/
Copy pathstructbind.spec
More file actions
121 lines (111 loc) · 3.13 KB
/
Copy pathstructbind.spec
File metadata and controls
121 lines (111 loc) · 3.13 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
# -*- mode: python ; coding: utf-8 -*-
import sys
import os
from pathlib import Path
block_cipher = None
# Base directories
BASE_DIR = Path(SPECPATH).resolve()
FRONTEND_DIST = BASE_DIR / 'frontend' / 'dist'
BACKEND_DIR = BASE_DIR / 'backend'
DATA_DIR = BACKEND_DIR / 'data'
APP_ICON = BASE_DIR / 'frontend' / 'public' / 'favicon.ico'
# Collect static assets to bundle inside the executable
datas = [
(str(FRONTEND_DIST), 'frontend/dist'),
(str(BACKEND_DIR / 'app'), 'backend/app'),
]
# Collect Meeko chemistry templates and parameter definitions
try:
from PyInstaller.utils.hooks import collect_data_files
datas += collect_data_files('meeko')
except Exception:
import meeko
meeko_data_dir = Path(meeko.__file__).resolve().parent / 'data'
if meeko_data_dir.exists():
datas.append((str(meeko_data_dir), 'meeko/data'))
# Collect OpenMM forcefields, template XMLs, and runtime libs if present
try:
from PyInstaller.utils.hooks import collect_data_files
datas += collect_data_files('openmm')
datas += collect_data_files('openmmforcefields')
datas += collect_data_files('pdbfixer')
import openmm
openmm_dir = Path(openmm.__file__).resolve().parent
openmm_libs = openmm_dir.parent / 'OpenMM.libs'
if openmm_libs.exists():
datas.append((str(openmm_libs), 'OpenMM.libs'))
except Exception:
pass
if DATA_DIR.exists():
datas.append((str(DATA_DIR), 'data'))
# Hidden imports needed by FastAPI, Uvicorn, and Scientific libraries
hiddenimports = [
'uvicorn',
'uvicorn.logging',
'uvicorn.loops',
'uvicorn.loops.auto',
'uvicorn.protocols',
'uvicorn.protocols.http',
'uvicorn.protocols.http.auto',
'uvicorn.protocols.websockets',
'uvicorn.protocols.websockets.auto',
'uvicorn.lifespan',
'uvicorn.lifespan.on',
'fastapi',
'fastapi.staticfiles',
'starlette',
'starlette.staticfiles',
'pydantic',
'sqlite3',
'multipart',
'python_multipart',
# Scientific libraries (packaged if installed in local environment)
'gemmi',
'rdkit',
'rdkit.Chem',
'meeko',
'openmm',
'openmm.app',
'openmm.unit',
'openmmforcefields',
'pdbfixer',
'app.api.system',
]
a = Analysis(
['run_offline.py'],
pathex=[str(BASE_DIR), str(BACKEND_DIR)],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['tkinter', 'matplotlib.tests', 'numpy.tests'],
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='StructBind',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # Set to False if you want a completely headless background process
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=str(APP_ICON) if APP_ICON.exists() else None,
)