forked from jsbattig/code-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyinstaller.spec
More file actions
108 lines (99 loc) · 2.61 KB
/
pyinstaller.spec
File metadata and controls
108 lines (99 loc) · 2.61 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
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec file for MCP Bridge (mcpb).
This spec file builds a single-file executable for the MCP Stdio Bridge.
The binary includes all dependencies and can run without a Python installation.
Usage:
pyinstaller --clean pyinstaller.spec
The output will be in dist/mcpb (or dist/mcpb.exe on Windows).
"""
import sys
from pathlib import Path
# Determine project root
spec_dir = Path(SPECPATH)
project_root = spec_dir
src_dir = project_root / "src"
# Add src to Python path for imports
sys.path.insert(0, str(src_dir))
a = Analysis(
# Entry point: mcpb __main__ module (no relative imports)
[str(src_dir / "code_indexer" / "mcpb" / "__main__.py")],
pathex=[str(src_dir)],
binaries=[],
datas=[],
# Hidden imports: modules not detected by static analysis
hiddenimports=[
# MCPB modules (required for relative imports)
"code_indexer.mcpb",
"code_indexer.mcpb.config",
"code_indexer.mcpb.diagnostics",
"code_indexer.mcpb.http_client",
"code_indexer.mcpb.protocol",
"code_indexer.mcpb.sse_parser",
"code_indexer.mcpb.manifest",
# HTTP/2 support for httpx
"httpx",
"h2",
"h2.connection",
"h2.config",
"h2.events",
"h2.exceptions",
"hpack",
"httpcore",
"httpcore._backends",
"httpcore._backends.sync",
"httpcore._sync",
# Pydantic for config validation
"pydantic",
"pydantic.fields",
"pydantic.main",
# JSON handling
"json",
# Async support
"asyncio",
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
# Exclude unnecessary modules to reduce binary size
excludes=[
"tkinter",
"unittest",
"test",
"pytest",
"setuptools",
"pip",
"wheel",
# Exclude heavy data science libraries if present
"numpy",
"pandas",
"scipy",
"matplotlib",
# Exclude testing frameworks
"pytest",
"hypothesis",
"coverage",
],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name="mcpb",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True, # Enable UPX compression for smaller binary
upx_exclude=[],
runtime_tmpdir=None,
console=True, # Console application (stdio bridge)
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)