Skip to content

Commit 7dd3b0f

Browse files
author
HenkVanHoek
committed
DEBUG: instead of onefile now one dir for debugging purpose.
1 parent e73f9fd commit 7dd3b0f

File tree

3 files changed

+53
-20
lines changed

3 files changed

+53
-20
lines changed

clone-vm.spec

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# clone-vm.spec (Final, Definitive Version)
1+
# clone-vm.spec (Directory Build Test)
22
# -*- mode: python ; coding: utf-8 -*-
33

44
from PyInstaller.utils.hooks import collect_dynamic_libs
5-
import sys
65

76
block_cipher = None
87

98
a = Analysis(
109
['run_clone.py'],
11-
binaries=[],
10+
binaries=collect_dynamic_libs('python'),
1211
datas=[],
1312
hiddenimports=[]
1413
)
@@ -19,9 +18,21 @@ exe = EXE(
1918
pyz,
2019
a.scripts,
2120
[],
21+
exclude_binaries=True, # Exclude from EXE, will be in COLLECT
2222
name='clone-vm',
2323
console=True,
2424
upx=True,
25-
version='file_version_info.txt',
26-
onefile=True,
25+
version='file_version_info.txt'
26+
)
27+
28+
# The COLLECT object creates the final output directory
29+
coll = COLLECT(
30+
exe,
31+
a.binaries,
32+
a.zipfiles,
33+
a.datas,
34+
strip=False,
35+
upx=True,
36+
upx_exclude=[],
37+
name='clone-vm'
2738
)

create-master-vm.spec

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# create-master-vm.spec (Final, Definitive Version)
1+
# create-master-vm.spec (Directory Build Test)
22
# -*- mode: python ; coding: utf-8 -*-
3-
import sys
3+
44
from PyInstaller.utils.hooks import collect_dynamic_libs
55

66
block_cipher = None
77

8-
binaries = []
9-
108
a = Analysis(
119
['run_create_master.py'],
12-
binaries=[],
10+
binaries=collect_dynamic_libs('python'),
1311
datas=[],
1412
hiddenimports=[]
1513
)
@@ -20,9 +18,21 @@ exe = EXE(
2018
pyz,
2119
a.scripts,
2220
[],
21+
exclude_binaries=True, # Exclude from EXE, will be in COLLECT
2322
name='create-master-vm',
2423
console=True,
2524
upx=True,
26-
version='file_version_info.txt',
27-
onefile=True
25+
version='file_version_info.txt'
26+
)
27+
28+
# The COLLECT object creates the final output directory
29+
coll = COLLECT(
30+
exe,
31+
a.binaries,
32+
a.zipfiles,
33+
a.datas,
34+
strip=False,
35+
upx=True,
36+
upx_exclude=[],
37+
name='create-master-vm'
2838
)

web-app.spec

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# web-app.spec (Final, Definitive Version)
1+
# web-app.spec (Directory Build Test)
22
# -*- mode: python ; coding: utf-8 -*-
33

44
from PyInstaller.utils.hooks import collect_dynamic_libs
5-
import sys
65

76
block_cipher = None
8-
binaries = []
97

108
a = Analysis(
119
['webapp/app.py'],
12-
binaries=binaries,
13-
# Ensure these paths are correct for your project structure
10+
binaries=collect_dynamic_libs('python'),
11+
# This ensures your web templates and static files are included.
12+
# Please verify these paths match your project structure.
1413
datas=[('webapp/templates', 'templates'), ('webapp/static', 'static')],
1514
hiddenimports=['waitress']
1615
)
@@ -21,10 +20,23 @@ exe = EXE(
2120
pyz,
2221
a.scripts,
2322
[],
23+
# This is a best practice for directory builds to avoid duplicating DLLs.
24+
exclude_binaries=True,
2425
name='pi-selfhosting-web',
25-
# This should be False for a web/GUI application to hide the console
2626
console=False,
2727
upx=True,
28-
version='file_version_info.txt',
29-
onefile=True
28+
version='file_version_info.txt'
29+
)
30+
31+
# The COLLECT object is what tells PyInstaller to create a final output directory
32+
# instead of a single file.
33+
coll = COLLECT(
34+
exe,
35+
a.binaries,
36+
a.zipfiles,
37+
a.datas,
38+
strip=False,
39+
upx=True,
40+
upx_exclude=[],
41+
name='pi-selfhosting-web'
3042
)

0 commit comments

Comments
 (0)