pyloid 0.19.1__py3-none-any.whl → 0.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyloid/__init__.py +2 -2
- pyloid/builder/__init__.py +45 -214
- pyloid/builder/build_config.schema.json +73 -0
- pyloid/builder/spec.py +247 -0
- {pyloid-0.19.1.dist-info → pyloid-0.20.0.dist-info}/METADATA +1 -1
- {pyloid-0.19.1.dist-info → pyloid-0.20.0.dist-info}/RECORD +8 -7
- pyloid/builder/build_config.json +0 -27
- {pyloid-0.19.1.dist-info → pyloid-0.20.0.dist-info}/LICENSE +0 -0
- {pyloid-0.19.1.dist-info → pyloid-0.20.0.dist-info}/WHEEL +0 -0
pyloid/__init__.py
CHANGED
@@ -3,6 +3,6 @@ from .api import PyloidAPI, Bridge
|
|
3
3
|
from .utils import get_production_path, is_production
|
4
4
|
from .tray import TrayEvent
|
5
5
|
from .timer import PyloidTimer
|
6
|
-
from .builder import build_from_spec,
|
6
|
+
from .builder import build_from_spec, cleanup_before_build, create_spec_from_json, get_site_packages
|
7
7
|
|
8
|
-
__all__ = ['Pyloid', 'PyloidAPI', 'Bridge', 'get_production_path', 'is_production', 'TrayEvent', 'PyloidTimer', 'build_from_spec', '
|
8
|
+
__all__ = ['Pyloid', 'PyloidAPI', 'Bridge', 'get_production_path', 'is_production', 'TrayEvent', 'PyloidTimer', 'build_from_spec', 'cleanup_before_build', 'create_spec_from_json', 'get_site_packages']
|
pyloid/builder/__init__.py
CHANGED
@@ -1,229 +1,50 @@
|
|
1
1
|
import json
|
2
|
-
import os
|
3
|
-
import subprocess
|
4
2
|
from pathlib import Path
|
5
|
-
from pyloid.utils import get_platform
|
6
3
|
from PyInstaller.__main__ import run as pyinstaller_run
|
7
4
|
import shutil
|
5
|
+
import site
|
6
|
+
from pyloid.builder.spec import create_spec_from_json
|
8
7
|
|
8
|
+
__all__ = ['create_spec_from_json', 'cleanup_before_build', 'build_from_spec', 'get_site_packages']
|
9
9
|
|
10
|
-
def
|
11
|
-
|
12
|
-
config = json.load(f)
|
13
|
-
|
14
|
-
# Create spec file for each OS
|
15
|
-
os_type = get_platform()
|
16
|
-
|
17
|
-
# Select template for each OS
|
18
|
-
if os_type == 'macos':
|
19
|
-
spec_content = _create_macos_spec(config)
|
20
|
-
elif os_type == 'linux':
|
21
|
-
spec_content = _create_linux_spec(config)
|
22
|
-
else: # windows
|
23
|
-
spec_content = _create_windows_spec(config)
|
24
|
-
|
25
|
-
# Save spec file
|
26
|
-
spec_path = Path(f"build-{os_type}.spec")
|
27
|
-
spec_path.write_text(spec_content, encoding='utf-8')
|
28
|
-
|
29
|
-
return str(spec_path)
|
30
|
-
|
31
|
-
def _create_windows_spec(config):
|
32
|
-
return f"""# -*- mode: python ; coding: utf-8 -*-
|
33
|
-
|
34
|
-
block_cipher = None
|
35
|
-
|
36
|
-
a = Analysis(
|
37
|
-
['{config['main_script']}'],
|
38
|
-
pathex={config.get('pathex', [])},
|
39
|
-
binaries={config.get('binaries', [])},
|
40
|
-
datas={config.get('datas', [])},
|
41
|
-
hiddenimports={config.get('hiddenimports', [])},
|
42
|
-
hookspath={config.get('hookspath', [])},
|
43
|
-
hooksconfig={config.get('hooksconfig', {})},
|
44
|
-
runtime_hooks={config.get('runtime_hooks', [])},
|
45
|
-
excludes={config.get('excludes', [])},
|
46
|
-
win_no_prefer_redirects=False,
|
47
|
-
win_private_assemblies=False,
|
48
|
-
cipher=block_cipher,
|
49
|
-
noarchive=False
|
50
|
-
)
|
51
|
-
|
52
|
-
pyz = PYZ(a.pure, a.zipped_data,
|
53
|
-
cipher=block_cipher)
|
54
|
-
|
55
|
-
exe = EXE(
|
56
|
-
pyz,
|
57
|
-
a.scripts,
|
58
|
-
[],
|
59
|
-
exclude_binaries=True,
|
60
|
-
name='{config.get("name", "pyloid-app")}',
|
61
|
-
debug=False,
|
62
|
-
bootloader_ignore_signals=False,
|
63
|
-
strip=False,
|
64
|
-
upx=True,
|
65
|
-
console=False,
|
66
|
-
disable_windowed_traceback=False,
|
67
|
-
argv_emulation=False,
|
68
|
-
target_arch=None,
|
69
|
-
codesign_identity=None,
|
70
|
-
entitlements_file=None,
|
71
|
-
icon='{config.get('icon', 'src-pyloid/icons/icon.ico')}'
|
72
|
-
)
|
73
|
-
|
74
|
-
coll = COLLECT(
|
75
|
-
exe,
|
76
|
-
a.binaries,
|
77
|
-
a.zipfiles,
|
78
|
-
a.datas,
|
79
|
-
strip=False,
|
80
|
-
upx=True,
|
81
|
-
upx_exclude=[],
|
82
|
-
name='{config.get("name", "pyloid-app")}'
|
83
|
-
)
|
84
|
-
"""
|
85
|
-
|
86
|
-
def _create_macos_spec(config):
|
87
|
-
return f"""# -*- mode: python ; coding: utf-8 -*-
|
88
|
-
|
89
|
-
a = Analysis(
|
90
|
-
['{config['main_script']}'],
|
91
|
-
pathex={config.get('pathex', [])},
|
92
|
-
binaries={config.get('binaries', [])},
|
93
|
-
datas={config.get('datas', [])},
|
94
|
-
hiddenimports={config.get('hiddenimports', [])},
|
95
|
-
hookspath={config.get('hookspath', [])},
|
96
|
-
hooksconfig={config.get('hooksconfig', {})},
|
97
|
-
runtime_hooks={config.get('runtime_hooks', [])},
|
98
|
-
excludes={config.get('excludes', [])},
|
99
|
-
noarchive=False,
|
100
|
-
optimize=0
|
101
|
-
)
|
102
|
-
|
103
|
-
pyz = PYZ(a.pure)
|
104
|
-
|
105
|
-
exe = EXE(
|
106
|
-
pyz,
|
107
|
-
a.scripts,
|
108
|
-
[],
|
109
|
-
exclude_binaries=True,
|
110
|
-
name='{config.get("name", "pyloid-app")}',
|
111
|
-
debug=False,
|
112
|
-
bootloader_ignore_signals=False,
|
113
|
-
strip=False,
|
114
|
-
upx=True,
|
115
|
-
console=False,
|
116
|
-
disable_windowed_traceback=False,
|
117
|
-
argv_emulation=False,
|
118
|
-
target_arch=None,
|
119
|
-
codesign_identity=None,
|
120
|
-
entitlements_file=None,
|
121
|
-
icon='{config.get('icon', 'src-pyloid/icons/icon.ico')}'
|
122
|
-
)
|
123
|
-
|
124
|
-
coll = COLLECT(
|
125
|
-
exe,
|
126
|
-
a.binaries,
|
127
|
-
a.datas,
|
128
|
-
strip=False,
|
129
|
-
upx=True,
|
130
|
-
upx_exclude=[],
|
131
|
-
name='{config.get("name", "pyloid-app")}'
|
132
|
-
)
|
133
|
-
|
134
|
-
app = BUNDLE(
|
135
|
-
coll,
|
136
|
-
name='{config.get("name", "pyloid-app")}.app',
|
137
|
-
icon='{config.get('icon', 'src-pyloid/icons/icon.icns')}',
|
138
|
-
bundle_identifier=None
|
139
|
-
)
|
140
|
-
"""
|
141
|
-
|
142
|
-
def _create_linux_spec(config):
|
143
|
-
return f"""# -*- mode: python ; coding: utf-8 -*-
|
144
|
-
|
145
|
-
block_cipher = None
|
146
|
-
|
147
|
-
a = Analysis(
|
148
|
-
['{config['main_script']}'],
|
149
|
-
pathex={config.get('pathex', [])},
|
150
|
-
binaries={config.get('binaries', [])},
|
151
|
-
datas={config.get('datas', [])},
|
152
|
-
hiddenimports={config.get('hiddenimports', [])},
|
153
|
-
hookspath={config.get('hookspath', [])},
|
154
|
-
hooksconfig={config.get('hooksconfig', {})},
|
155
|
-
runtime_hooks={config.get('runtime_hooks', [])},
|
156
|
-
excludes={config.get('excludes', [])},
|
157
|
-
win_no_prefer_redirects=False,
|
158
|
-
win_private_assemblies=False,
|
159
|
-
cipher=block_cipher,
|
160
|
-
noarchive=False
|
161
|
-
)
|
162
|
-
|
163
|
-
pyz = PYZ(a.pure, a.zipped_data,
|
164
|
-
cipher=block_cipher)
|
165
|
-
|
166
|
-
exe = EXE(
|
167
|
-
pyz,
|
168
|
-
a.scripts,
|
169
|
-
[],
|
170
|
-
exclude_binaries=True,
|
171
|
-
name='{config.get("name", "pyloid-app")}',
|
172
|
-
debug=False,
|
173
|
-
bootloader_ignore_signals=False,
|
174
|
-
strip=False,
|
175
|
-
upx=True,
|
176
|
-
console=False,
|
177
|
-
disable_windowed_traceback=False,
|
178
|
-
argv_emulation=False,
|
179
|
-
target_arch=None,
|
180
|
-
codesign_identity=None,
|
181
|
-
entitlements_file=None,
|
182
|
-
icon={config.get('icon', 'src-pyloid/icons/icon.png')}
|
183
|
-
)
|
184
|
-
|
185
|
-
coll = COLLECT(
|
186
|
-
exe,
|
187
|
-
a.binaries,
|
188
|
-
a.zipfiles,
|
189
|
-
a.datas,
|
190
|
-
strip=False,
|
191
|
-
upx=True,
|
192
|
-
upx_exclude=[],
|
193
|
-
name='{config.get("name", "pyloid-app")}'
|
194
|
-
)
|
195
|
-
"""
|
196
|
-
|
197
|
-
def cleanup_after_build(json_path):
|
198
|
-
"""Function to clean up unnecessary files after build"""
|
10
|
+
def cleanup_before_build(json_path):
|
11
|
+
"""Function to clean up unnecessary files before build"""
|
199
12
|
try:
|
200
13
|
with open(json_path, 'r', encoding='utf-8') as f:
|
201
14
|
config = json.load(f)
|
202
15
|
|
203
|
-
cleanup_patterns = config.get('cleanup_patterns', [])
|
16
|
+
cleanup_patterns = config.get('before_build', {}).get('cleanup_patterns', [])
|
204
17
|
if not cleanup_patterns:
|
205
|
-
return
|
18
|
+
return Exception("Cannot find cleanup patterns.")
|
19
|
+
|
20
|
+
site_packages = get_site_packages()
|
21
|
+
if not site_packages:
|
22
|
+
raise Exception("Cannot find site-packages directory.")
|
206
23
|
|
207
|
-
dist_dir = Path(f'
|
24
|
+
dist_dir = Path(f'{site_packages}')
|
208
25
|
if not dist_dir.exists():
|
209
|
-
|
210
|
-
return False
|
26
|
+
raise Exception(f"Cannot find directory to clean: {dist_dir}")
|
211
27
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
28
|
+
if not cleanup_patterns:
|
29
|
+
print("\033[1;33mNo cleanup patterns found. Files may have already been removed.\033[0m")
|
30
|
+
else:
|
31
|
+
print("\033[1;34mCleaning up unnecessary files...\033[0m")
|
32
|
+
for pattern in cleanup_patterns:
|
33
|
+
matching_files = list(dist_dir.glob(pattern))
|
34
|
+
if not matching_files:
|
35
|
+
print(f"\033[1;33mAleady removed: {pattern}\033[0m")
|
36
|
+
for file_path in matching_files:
|
37
|
+
print(f"\033[33mRemoving: {file_path}\033[0m")
|
38
|
+
if file_path.is_dir():
|
39
|
+
shutil.rmtree(file_path)
|
40
|
+
else:
|
41
|
+
file_path.unlink()
|
42
|
+
print(f"\033[32mRemoved: {file_path}\033[0m")
|
220
43
|
|
221
|
-
print("
|
222
|
-
return True
|
44
|
+
print("\033[1;32mFile cleanup completed.\033[0m")
|
223
45
|
|
224
46
|
except Exception as e:
|
225
|
-
|
226
|
-
return False
|
47
|
+
raise Exception(f"\033[1;31mError occurred during file cleanup: {e}\033[0m")
|
227
48
|
|
228
49
|
def build_from_spec(spec_path):
|
229
50
|
try:
|
@@ -233,17 +54,27 @@ def build_from_spec(spec_path):
|
|
233
54
|
])
|
234
55
|
print("Build completed.")
|
235
56
|
|
236
|
-
return True
|
237
57
|
except Exception as e:
|
238
|
-
|
239
|
-
|
58
|
+
raise Exception(f"Error occurred during build: {e}")
|
59
|
+
|
60
|
+
def get_site_packages():
|
61
|
+
"""
|
62
|
+
Returns the path to the site-packages directory.
|
63
|
+
Raises an exception if the directory is not found.
|
64
|
+
"""
|
65
|
+
for path in site.getsitepackages():
|
66
|
+
if 'site-packages' in path:
|
67
|
+
return path
|
68
|
+
raise Exception("Site-packages directory not found.")
|
240
69
|
|
241
70
|
def main():
|
242
71
|
spec_path = create_spec_from_json('build_config.json')
|
243
72
|
|
244
|
-
|
73
|
+
cleanup_before_build('build_config.json')
|
74
|
+
|
75
|
+
# build_from_spec(spec_path)
|
76
|
+
|
245
77
|
|
246
|
-
cleanup_after_build('build_config.json')
|
247
78
|
|
248
79
|
if __name__ == "__main__":
|
249
80
|
main()
|
@@ -0,0 +1,73 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"required": ["before_build", "name", "main_script", "datas", "excludes", "icon", "bundle"],
|
5
|
+
"properties": {
|
6
|
+
"before_build": {
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"cleanup_patterns": {
|
10
|
+
"type": "array",
|
11
|
+
"items": {
|
12
|
+
"type": "string"
|
13
|
+
},
|
14
|
+
"description": "List of file patterns to clean up in the library folder before building (used to remove files that cannot be excluded through pyinstaller) - default path is site-packages"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"name": {
|
19
|
+
"type": "string",
|
20
|
+
"description": "Application name"
|
21
|
+
},
|
22
|
+
"main_script": {
|
23
|
+
"type": "string",
|
24
|
+
"description": "Path to the main Python script"
|
25
|
+
},
|
26
|
+
"datas": {
|
27
|
+
"type": "array",
|
28
|
+
"items": {
|
29
|
+
"type": "array",
|
30
|
+
"minItems": 2,
|
31
|
+
"maxItems": 2,
|
32
|
+
"items": [
|
33
|
+
{ "type": "string" },
|
34
|
+
{ "type": "string" }
|
35
|
+
]
|
36
|
+
},
|
37
|
+
"description": "List of data files to include [source path, destination path]"
|
38
|
+
},
|
39
|
+
"excludes": {
|
40
|
+
"type": "array",
|
41
|
+
"items": {
|
42
|
+
"type": "string"
|
43
|
+
},
|
44
|
+
"description": "List of modules to exclude during build with pyinstaller"
|
45
|
+
},
|
46
|
+
"icon": {
|
47
|
+
"type": "string",
|
48
|
+
"description": "Path to the application icon file"
|
49
|
+
},
|
50
|
+
"bundle": {
|
51
|
+
"type": "object",
|
52
|
+
"properties": {
|
53
|
+
"windows": {
|
54
|
+
"type": "string",
|
55
|
+
"enum": ["onefile", "directory"],
|
56
|
+
"description": "Windows build type"
|
57
|
+
},
|
58
|
+
"macos": {
|
59
|
+
"type": "string",
|
60
|
+
"enum": ["app"],
|
61
|
+
"description": "macOS build type"
|
62
|
+
},
|
63
|
+
"linux": {
|
64
|
+
"type": "string",
|
65
|
+
"enum": ["onefile", "directory"],
|
66
|
+
"description": "Linux build type"
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"required": ["windows", "macos", "linux"],
|
70
|
+
"description": "Build settings for each OS"
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
pyloid/builder/spec.py
ADDED
@@ -0,0 +1,247 @@
|
|
1
|
+
from pyloid.utils import get_platform
|
2
|
+
import json
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
def create_spec_from_json(json_path):
|
6
|
+
with open(json_path, 'r', encoding='utf-8') as f:
|
7
|
+
config = json.load(f)
|
8
|
+
|
9
|
+
os_type = get_platform()
|
10
|
+
|
11
|
+
if os_type == 'macos':
|
12
|
+
spec_content = _create_macos_spec(config)
|
13
|
+
elif os_type == 'linux':
|
14
|
+
spec_content = _create_linux_spec(config)
|
15
|
+
else: # windows
|
16
|
+
spec_content = _create_windows_spec(config)
|
17
|
+
|
18
|
+
spec_path = Path(f"build-{os_type}.spec")
|
19
|
+
spec_path.write_text(spec_content, encoding='utf-8')
|
20
|
+
|
21
|
+
return str(spec_path)
|
22
|
+
|
23
|
+
def _create_windows_spec(config):
|
24
|
+
bundle_type = config.get('bundle', {}).get('windows', 'directory')
|
25
|
+
|
26
|
+
base_spec = f"""# -*- mode: python ; coding: utf-8 -*-
|
27
|
+
|
28
|
+
block_cipher = None
|
29
|
+
|
30
|
+
a = Analysis(
|
31
|
+
['{config['main_script']}'],
|
32
|
+
pathex={config.get('pathex', [])},
|
33
|
+
binaries={config.get('binaries', [])},
|
34
|
+
datas={config.get('datas', [])},
|
35
|
+
hiddenimports={config.get('hiddenimports', [])},
|
36
|
+
hookspath={config.get('hookspath', [])},
|
37
|
+
hooksconfig={config.get('hooksconfig', {})},
|
38
|
+
runtime_hooks={config.get('runtime_hooks', [])},
|
39
|
+
excludes={config.get('excludes', [])},
|
40
|
+
win_no_prefer_redirects=False,
|
41
|
+
win_private_assemblies=False,
|
42
|
+
cipher=block_cipher,
|
43
|
+
noarchive=False
|
44
|
+
)
|
45
|
+
|
46
|
+
pyz = PYZ(a.pure, a.zipped_data,
|
47
|
+
cipher=block_cipher)
|
48
|
+
"""
|
49
|
+
|
50
|
+
if bundle_type == 'onefile':
|
51
|
+
return base_spec + f"""
|
52
|
+
exe = EXE(
|
53
|
+
pyz,
|
54
|
+
a.scripts,
|
55
|
+
a.binaries,
|
56
|
+
a.zipfiles,
|
57
|
+
a.datas,
|
58
|
+
[],
|
59
|
+
name='{config.get("name", "pyloid-app")}',
|
60
|
+
debug=False,
|
61
|
+
bootloader_ignore_signals=False,
|
62
|
+
strip=False,
|
63
|
+
upx=True,
|
64
|
+
upx_exclude=[],
|
65
|
+
runtime_tmpdir=None,
|
66
|
+
console=False,
|
67
|
+
disable_windowed_traceback=False,
|
68
|
+
argv_emulation=False,
|
69
|
+
target_arch=None,
|
70
|
+
codesign_identity=None,
|
71
|
+
entitlements_file=None,
|
72
|
+
icon='{config.get('icon', 'src-pyloid/icons/icon.ico')}'
|
73
|
+
)
|
74
|
+
"""
|
75
|
+
else:
|
76
|
+
return base_spec + f"""
|
77
|
+
exe = EXE(
|
78
|
+
pyz,
|
79
|
+
a.scripts,
|
80
|
+
[],
|
81
|
+
exclude_binaries=True,
|
82
|
+
name='{config.get("name", "pyloid-app")}',
|
83
|
+
debug=False,
|
84
|
+
bootloader_ignore_signals=False,
|
85
|
+
strip=False,
|
86
|
+
upx=True,
|
87
|
+
console=False,
|
88
|
+
disable_windowed_traceback=False,
|
89
|
+
argv_emulation=False,
|
90
|
+
target_arch=None,
|
91
|
+
codesign_identity=None,
|
92
|
+
entitlements_file=None,
|
93
|
+
icon='{config.get('icon', 'src-pyloid/icons/icon.ico')}'
|
94
|
+
)
|
95
|
+
|
96
|
+
coll = COLLECT(
|
97
|
+
exe,
|
98
|
+
a.binaries,
|
99
|
+
a.zipfiles,
|
100
|
+
a.datas,
|
101
|
+
strip=False,
|
102
|
+
upx=True,
|
103
|
+
upx_exclude=[],
|
104
|
+
name='{config.get("name", "pyloid-app")}'
|
105
|
+
)
|
106
|
+
"""
|
107
|
+
|
108
|
+
def _create_macos_spec(config):
|
109
|
+
return f"""# -*- mode: python ; coding: utf-8 -*-
|
110
|
+
|
111
|
+
a = Analysis(
|
112
|
+
['{config['main_script']}'],
|
113
|
+
pathex={config.get('pathex', [])},
|
114
|
+
binaries={config.get('binaries', [])},
|
115
|
+
datas={config.get('datas', [])},
|
116
|
+
hiddenimports={config.get('hiddenimports', [])},
|
117
|
+
hookspath={config.get('hookspath', [])},
|
118
|
+
hooksconfig={config.get('hooksconfig', {})},
|
119
|
+
runtime_hooks={config.get('runtime_hooks', [])},
|
120
|
+
excludes={config.get('excludes', [])},
|
121
|
+
noarchive=False,
|
122
|
+
optimize=0
|
123
|
+
)
|
124
|
+
|
125
|
+
pyz = PYZ(a.pure)
|
126
|
+
|
127
|
+
exe = EXE(
|
128
|
+
pyz,
|
129
|
+
a.scripts,
|
130
|
+
[],
|
131
|
+
exclude_binaries=True,
|
132
|
+
name='{config.get("name", "pyloid-app")}',
|
133
|
+
debug=False,
|
134
|
+
bootloader_ignore_signals=False,
|
135
|
+
strip=False,
|
136
|
+
upx=True,
|
137
|
+
console=False,
|
138
|
+
disable_windowed_traceback=False,
|
139
|
+
argv_emulation=False,
|
140
|
+
target_arch=None,
|
141
|
+
codesign_identity=None,
|
142
|
+
entitlements_file=None,
|
143
|
+
icon='{config.get('icon', 'src-pyloid/icons/icon.ico')}'
|
144
|
+
)
|
145
|
+
|
146
|
+
coll = COLLECT(
|
147
|
+
exe,
|
148
|
+
a.binaries,
|
149
|
+
a.datas,
|
150
|
+
strip=False,
|
151
|
+
upx=True,
|
152
|
+
upx_exclude=[],
|
153
|
+
name='{config.get("name", "pyloid-app")}'
|
154
|
+
)
|
155
|
+
|
156
|
+
app = BUNDLE(
|
157
|
+
coll,
|
158
|
+
name='{config.get("name", "pyloid-app")}.app',
|
159
|
+
icon='{config.get('icon', 'src-pyloid/icons/icon.icns')}',
|
160
|
+
bundle_identifier=None
|
161
|
+
)
|
162
|
+
"""
|
163
|
+
|
164
|
+
def _create_linux_spec(config):
|
165
|
+
bundle_type = config.get('bundle', {}).get('linux', 'directory')
|
166
|
+
|
167
|
+
base_spec = f"""# -*- mode: python ; coding: utf-8 -*-
|
168
|
+
|
169
|
+
block_cipher = None
|
170
|
+
|
171
|
+
a = Analysis(
|
172
|
+
['{config['main_script']}'],
|
173
|
+
pathex={config.get('pathex', [])},
|
174
|
+
binaries={config.get('binaries', [])},
|
175
|
+
datas={config.get('datas', [])},
|
176
|
+
hiddenimports={config.get('hiddenimports', [])},
|
177
|
+
hookspath={config.get('hookspath', [])},
|
178
|
+
hooksconfig={config.get('hooksconfig', {})},
|
179
|
+
runtime_hooks={config.get('runtime_hooks', [])},
|
180
|
+
excludes={config.get('excludes', [])},
|
181
|
+
win_no_prefer_redirects=False,
|
182
|
+
win_private_assemblies=False,
|
183
|
+
cipher=block_cipher,
|
184
|
+
noarchive=False
|
185
|
+
)
|
186
|
+
|
187
|
+
pyz = PYZ(a.pure, a.zipped_data,
|
188
|
+
cipher=block_cipher)
|
189
|
+
"""
|
190
|
+
|
191
|
+
if bundle_type == 'onefile':
|
192
|
+
return base_spec + f"""
|
193
|
+
exe = EXE(
|
194
|
+
pyz,
|
195
|
+
a.scripts,
|
196
|
+
a.binaries,
|
197
|
+
a.zipfiles,
|
198
|
+
a.datas,
|
199
|
+
[],
|
200
|
+
name='{config.get("name", "pyloid-app")}',
|
201
|
+
debug=False,
|
202
|
+
bootloader_ignore_signals=False,
|
203
|
+
strip=False,
|
204
|
+
upx=True,
|
205
|
+
upx_exclude=[],
|
206
|
+
runtime_tmpdir=None,
|
207
|
+
console=False,
|
208
|
+
disable_windowed_traceback=False,
|
209
|
+
argv_emulation=False,
|
210
|
+
target_arch=None,
|
211
|
+
codesign_identity=None,
|
212
|
+
entitlements_file=None,
|
213
|
+
icon={config.get('icon', 'src-pyloid/icons/icon.png')}
|
214
|
+
)
|
215
|
+
"""
|
216
|
+
else:
|
217
|
+
return base_spec + f"""
|
218
|
+
exe = EXE(
|
219
|
+
pyz,
|
220
|
+
a.scripts,
|
221
|
+
[],
|
222
|
+
exclude_binaries=True,
|
223
|
+
name='{config.get("name", "pyloid-app")}',
|
224
|
+
debug=False,
|
225
|
+
bootloader_ignore_signals=False,
|
226
|
+
strip=False,
|
227
|
+
upx=True,
|
228
|
+
console=False,
|
229
|
+
disable_windowed_traceback=False,
|
230
|
+
argv_emulation=False,
|
231
|
+
target_arch=None,
|
232
|
+
codesign_identity=None,
|
233
|
+
entitlements_file=None,
|
234
|
+
icon={config.get('icon', 'src-pyloid/icons/icon.png')}
|
235
|
+
)
|
236
|
+
|
237
|
+
coll = COLLECT(
|
238
|
+
exe,
|
239
|
+
a.binaries,
|
240
|
+
a.zipfiles,
|
241
|
+
a.datas,
|
242
|
+
strip=False,
|
243
|
+
upx=True,
|
244
|
+
upx_exclude=[],
|
245
|
+
name='{config.get("name", "pyloid-app")}'
|
246
|
+
)
|
247
|
+
"""
|
@@ -1,9 +1,10 @@
|
|
1
|
-
pyloid/__init__.py,sha256=
|
1
|
+
pyloid/__init__.py,sha256=t1_67LkSfP4F1TYq4-62z5Cc3Gx1jyWI1yXux7Ojaug,484
|
2
2
|
pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
|
3
3
|
pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
4
4
|
pyloid/browser_window.py,sha256=6Es-DH45URUV6rlCBWj3ZWwrXLMUvqp5700WlU8Sdwo,62984
|
5
|
-
pyloid/builder/__init__.py,sha256=
|
6
|
-
pyloid/builder/build_config.json,sha256=
|
5
|
+
pyloid/builder/__init__.py,sha256=ZYWcCRp1PQISO0C9CBxlqwrRbQUNqdoMlH4xkhYzcrM,2856
|
6
|
+
pyloid/builder/build_config.schema.json,sha256=Wj4_RCxXrQE9lq9Qxen1oy1Q0lhi2ojDkln8YX_LntM,2213
|
7
|
+
pyloid/builder/spec.py,sha256=eTZ6b3ksysjH1mnorBtHFsMI7r9jGmCOJGcpJvNmY_E,6119
|
7
8
|
pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
|
8
9
|
pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
|
9
10
|
pyloid/js_api/event_api.py,sha256=_52yyBonqecmMvJpFW7OMNi_jX8Nrteqw_kI6r-DGG0,951
|
@@ -14,7 +15,7 @@ pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
|
|
14
15
|
pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
15
16
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
16
17
|
pyloid/utils.py,sha256=mAjuppRXlZAocggf8La00Ae0Qzi4IRL_ovG87x4wagI,3300
|
17
|
-
pyloid-0.
|
18
|
-
pyloid-0.
|
19
|
-
pyloid-0.
|
20
|
-
pyloid-0.
|
18
|
+
pyloid-0.20.0.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
19
|
+
pyloid-0.20.0.dist-info/METADATA,sha256=OBjfyn3s22LjbPf8wLVAbdKVnxuoJn8e8TPl84ZXOf0,3095
|
20
|
+
pyloid-0.20.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
21
|
+
pyloid-0.20.0.dist-info/RECORD,,
|
pyloid/builder/build_config.json
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "pyloid-app",
|
3
|
-
"datas": [
|
4
|
-
["src-pyloid/icons/", "src-pyloid/icons/"],
|
5
|
-
["build-front/", "build-front/"]
|
6
|
-
],
|
7
|
-
"excludes": [
|
8
|
-
"PySide6.QtQml",
|
9
|
-
"PySide6.QtTest",
|
10
|
-
"PySide6.Qt3D",
|
11
|
-
"PySide6.QtSensors",
|
12
|
-
"PySide6.QtCharts",
|
13
|
-
"PySide6.QtGraphs",
|
14
|
-
"PySide6.QtDataVisualization",
|
15
|
-
"PySide6.QtQuick",
|
16
|
-
"PySide6.QtDesigner",
|
17
|
-
"PySide6.QtUiTools",
|
18
|
-
"PySide6.QtHelp"
|
19
|
-
],
|
20
|
-
"icon": "src-pyloid/icons/icon.ico",
|
21
|
-
"after_build": {
|
22
|
-
"cleanup_patterns": [
|
23
|
-
"_internal/PySide*/opengl32sw.dll",
|
24
|
-
"_internal/PySide*/translations"
|
25
|
-
]
|
26
|
-
}
|
27
|
-
}
|
File without changes
|
File without changes
|