forked from BradHN1/HPAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_py2exe.py
More file actions
62 lines (50 loc) · 2.07 KB
/
setup_py2exe.py
File metadata and controls
62 lines (50 loc) · 2.07 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
import sys
import glob
from distutils.core import setup
import py2exe
import os
# Remove the build folder, a bit slower but ensures that build contains the latest
import shutil
shutil.rmtree("build", ignore_errors=True)
matplot_lib_data_files = []
includes = []
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger',
'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
'Tkconstants', 'Tkinter', 'pydoc', 'doctest', 'test', 'sqlite3'
]
packages = ['pytz']
dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
'tk84.dll']
icon_resources = []
bitmap_resources = []
other_resources = []
# add the mpl mpl-data folder and rc file
import matplotlib as mpl
matplot_lib_data_files += mpl.get_py2exe_datafiles()
f2 = ("", [r'./Cold Climate Air-Source Heat Pump Listing.txt'])
matplot_lib_data_files.append(f2)
matplot_lib_data_files.append(("Climate Data", glob.glob(r'.\Climate Data\*.*')))
matplot_lib_data_files.append(("Residential Profiles", glob.glob(r'.\Residential Profiles\Default oil deliveries.txt')))
setup(
windows=[{"script" : "Heat Pump Analysis.py"}],
# compressed and optimize reduce the size
options = {"py2exe": {"compressed": 2,
"optimize": 2,
"includes": includes,
"excludes": excludes,
"packages": packages,
"dll_excludes": dll_excludes,
# using 2 to reduce number of files in dist folder
# using 1 is not recommended as it often does not work
"bundle_files": 2,
"dist_dir": 'dist',
"xref": False,
"skip_archive": False,
"ascii": False,
"custom_boot_script": '',
}
},
# using zipfile to reduce number of files in dist
zipfile = r'lib\library.zip',
data_files=matplot_lib_data_files
)