-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrushti.spec
More file actions
136 lines (119 loc) · 4.1 KB
/
rushti.spec
File metadata and controls
136 lines (119 loc) · 4.1 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
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for RushTI
Build command:
pyinstaller rushti.spec --clean
This creates a one-directory distribution with ALL features:
- TM1 integration and asset management
- Database admin utilities
- DAG visualization (interactive HTML with vis.js, no external dependencies)
- All optional components
Using --onedir mode (COLLECT) instead of --onefile for faster cold start times.
The single-file mode extracts to a temp directory on each run, causing ~20s delays
on Windows servers. The one-directory mode eliminates this extraction overhead.
TM1 object definitions (dimensions, cube, process, sample data) are embedded
as Python constants in tm1_objects.py — no external asset files are needed.
After building, copy the following to the distribution directory:
- config/config.ini.template -> config.ini (edit with your TM1 settings)
- config/logging_config.ini -> logging_config.ini (or config/logging_config.ini)
- config/settings.ini.template -> settings.ini (optional, for custom defaults)
The executable looks for config files in order:
1. CLI argument (e.g., --settings for settings.ini)
2. RUSHTI_DIR environment variable ({RUSHTI_DIR}/config/{filename})
3. ./{filename} (current directory - legacy)
4. ./config/{filename} (config subdirectory - recommended)
RUSHTI_DIR also controls the root for all app data (logs, stats db, checkpoints, visualizations).
"""
import re
from pathlib import Path
from PyInstaller.utils.hooks import collect_submodules
# Extract version from src/rushti/__init__.py
version = "0.0.0"
init_path = Path("src/rushti/__init__.py")
if init_path.exists():
content = init_path.read_text()
match = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
if match:
version = match.group(1)
print(f"Building RushTI version {version}")
# Package directory - use absolute path
src_dir = Path("src").resolve()
# No external data files needed — all templates are embedded as Python constants
# (visualization_template.py for DAG, dashboard.py for dashboard)
datas = []
# Collect all rushti submodules
rushti_imports = collect_submodules('rushti')
print(f"Collected rushti submodules: {rushti_imports}")
a = Analysis(
['__main__.py'],
pathex=[str(src_dir)], # Include src/ directory so PyInstaller can find the rushti package
binaries=[],
datas=datas,
hiddenimports=rushti_imports + [
# TM1py submodules that PyInstaller might miss
'TM1py.Objects',
'TM1py.Objects.Element',
'TM1py.Objects.Cube',
'TM1py.Objects.Dimension',
'TM1py.Objects.Process',
'TM1py.Objects.Subset',
'TM1py.Objects.NativeView',
'TM1py.Objects.MDXView',
'TM1py.Exceptions',
# Third-party dependencies
'pandas',
'chardet',
'keyring',
# Windows timezone support (required for TM1 security mode 3 with delegated auth)
'win32timezone',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude dev dependencies
'pytest',
'pytest-asyncio',
'pytest-cov',
'black',
'isort',
'flake8',
'mypy',
# Graphviz no longer used (HTML visualization only)
'graphviz',
],
noarchive=False,
)
pyz = PYZ(a.pure)
# Using --onedir mode for faster cold start times
# The single-file mode extracts to a temp directory on each run, causing ~20s delays
# on Windows servers. The one-directory mode eliminates this extraction overhead.
exe = EXE(
pyz,
a.scripts,
[], # Don't include binaries/datas in EXE for onedir mode
exclude_binaries=True, # Required for onedir mode
name='rushti',
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,
)
# Collect all files into a directory
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='rushti',
)