-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherdos-solver.spec
More file actions
122 lines (113 loc) · 2.9 KB
/
Copy patherdos-solver.spec
File metadata and controls
122 lines (113 loc) · 2.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
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec for Erdos Proof Mining solver.
Bundles the solver and all LLM provider dependencies into a single executable.
The resulting binary is used as a Tauri sidecar — the GUI launches it as a
subprocess and communicates via JSON Lines on stdout.
"""
import os
from PyInstaller.utils.hooks import collect_submodules
# src/solver.py uses package-relative imports, so it cannot be the entry
# script itself (PyInstaller runs the entry script as __main__, which has no
# parent package). Generate a tiny absolute-import launcher in the build
# workpath instead. `workpath` and `SPECPATH` are provided by PyInstaller.
os.makedirs(workpath, exist_ok=True)
launcher = os.path.join(workpath, 'erdos-solver-launcher.py')
with open(launcher, 'w', encoding='utf-8') as f:
f.write(
'from src.solver import main\n'
'\n'
'if __name__ == "__main__":\n'
' main()\n'
)
# Collect all submodules for providers that use dynamic imports
hidden_imports = [
# Core
'src.solver',
'src.config',
'src.events',
'src.validator',
'src.packager',
'src.environment',
'src.manifest',
'src.campaign',
'src.sandbox',
'src.logging_config',
# LLM providers
'src.llm',
'src.llm.factory',
'src.llm.base',
'src.llm.mock',
'src.llm.openai_provider',
'src.llm.anthropic_provider',
'src.llm.chatgpt_provider',
'src.llm.openrouter_provider',
'src.llm.gemini',
'src.llm.ollama_provider',
# Third-party with dynamic imports
'google.generativeai',
'google.ai.generativelanguage',
'google.auth',
'google.auth.transport.requests',
'google.api_core',
'openai',
'anthropic',
'httpx',
'httpcore',
'certifi',
'charset_normalizer',
'idna',
'urllib3',
'requests',
]
# Collect google-generativeai submodules (heavily dynamic)
try:
hidden_imports += collect_submodules('google.generativeai')
hidden_imports += collect_submodules('google.ai')
except Exception:
pass
a = Analysis(
[launcher],
pathex=[SPECPATH],
binaries=[],
datas=[
('manifest.json', '.'),
],
hiddenimports=hidden_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
'tkinter',
'matplotlib',
'numpy',
'scipy',
'pandas',
'PIL',
'cv2',
'torch',
'tensorflow',
],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='erdos-solver',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True, # Must be console app — Tauri reads stdout
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=None,
)