-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_analysis.spec
More file actions
93 lines (80 loc) · 2.87 KB
/
Copy pathdata_analysis.spec
File metadata and controls
93 lines (80 loc) · 2.87 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
# -*- mode: python ; coding: utf-8 -*-
import pathlib
import site
import sys
import gooey
gooey_root = os.path.dirname(gooey.__file__)
gooey_languages = Tree(os.path.join(gooey_root, 'languages'), prefix = 'gooey/languages')
gooey_images = Tree(os.path.join(gooey_root, 'images'), prefix = 'gooey/images')
from PyInstaller.building.api import EXE, PYZ, COLLECT
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.datastruct import Tree
from PyInstaller.building.osx import BUNDLE
for path in site.getsitepackages():
if path.endswith("site-packages"):
site_pkgs = pathlib.Path(path)
break
pptx_templates = site_pkgs.joinpath('pptx').joinpath('templates').joinpath('default.pptx')
cwd = pathlib.Path.cwd()
filename = "data_analysis.py"
block_cipher = None
if sys.platform != "darwin":
a = Analysis([filename],
pathex=[str(cwd.joinpath(filename))],
binaries=[],
datas=[(str(pptx_templates), str(pathlib.Path('.').joinpath('pptx').joinpath('templates')))],
hiddenimports=['PIL._tkinter_finder', 'matplotlib.backends.backend_svg'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=filename.strip(".py"),
debug=True,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
icon=os.path.join(gooey_root, 'images', 'program_icon.ico'))
else:
a = Analysis([filename],
pathex=[str(cwd.joinpath(filename))],
datas=[(str(pptx_templates), str(pathlib.Path('.').joinpath('pptx').joinpath('templates')))],
hiddenimports=[],
hookspath=None,
runtime_hooks=None,
)
pyz = PYZ(a.pure)
options = [('u', None, 'OPTION'), ('v', None, 'OPTION'), ('w', None, 'OPTION')]
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
options,
gooey_languages,
gooey_images,
name=filename.strip(".py"),
debug=False,
strip=None,
upx=True,
console=False,
icon=os.path.join(gooey_root, 'images', 'program_icon.ico'))
info_plist = {'addition_prop': 'additional_value'}
app = BUNDLE(exe,
name=filename.replace(".py", ".app"),
bundle_identifier=None,
info_plist=info_plist
)