-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyinstaller.spec
More file actions
125 lines (116 loc) · 2.96 KB
/
pyinstaller.spec
File metadata and controls
125 lines (116 loc) · 2.96 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
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for the PLC Ontology Assistant Python backend.
Produces a one-folder distribution at build/python-backend/
containing dispatcher.exe and all required scripts + dependencies.
Usage:
pyinstaller pyinstaller.spec
"""
import os
from pathlib import Path
block_cipher = None
# Collect every .py file in scripts/ as data (they are executed at runtime
# via runpy.run_path inside the dispatcher).
scripts_dir = os.path.join(SPECPATH, 'scripts')
script_files = [
(os.path.join(scripts_dir, f), 'scripts')
for f in os.listdir(scripts_dir)
if f.endswith('.py') and f != 'dispatcher.py'
]
a = Analysis(
[os.path.join('scripts', 'dispatcher.py')],
pathex=[scripts_dir],
binaries=[],
datas=script_files,
# Hidden imports: packages that PyInstaller can't discover because they
# are only referenced inside the data-file scripts (loaded via runpy).
hiddenimports=[
# --- Third-party (from requirements.txt) ---
'neo4j',
'neo4j.api',
'neo4j._sync.driver',
'neo4j._sync.work',
'neo4j._async.driver',
'neo4j._codec.hydration',
'neo4j._codec.packstream',
'anthropic',
'anthropic._client',
'anthropic.resources',
'anthropic.types',
'dotenv',
'lxml',
'lxml.etree',
'lxml._elementpath',
'pyodbc',
# --- Stdlib modules used by scripts ---
'json',
'argparse',
'pathlib',
'dataclasses',
'enum',
'contextlib',
'typing',
'datetime',
're',
'html',
'difflib',
'shutil',
'tempfile',
'xml.etree.ElementTree',
# --- httpx / httpcore (transitive dep of anthropic) ---
'httpx',
'httpcore',
'httpcore._async',
'httpcore._sync',
'h11',
'certifi',
'idna',
'sniffio',
'anyio',
'anyio._backends',
'anyio._backends._asyncio',
'socksio',
'hpack',
'hyperframe',
# --- pydantic (transitive dep of anthropic) ---
'pydantic',
'pydantic.deprecated',
'pydantic_core',
'annotated_types',
'typing_extensions',
# --- other transitive ---
'distro',
'jiter',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# CODESYS-only modules (won't be available outside CODESYS IDE)
'scriptengine',
],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='dispatcher',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True, # must be True – scripts write to stdout/stderr
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='python-backend',
)