-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild_exe.py
131 lines (108 loc) · 3.55 KB
/
build_exe.py
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
# -*- coding: utf-8 -*-
"""
<Short Summary>
Created on Wed Aug 05 10:33:35 2015
<Long Description>
Usage:
new_program.py
Options:
-h --help # Show this screen.
--version # Show version.
"""
# ---------------------------------------------------------------------------
### Imports
# ---------------------------------------------------------------------------
# Standard Library
import sys
import logging
import os.path
import glob
# Third Party
from cx_Freeze import setup, Executable
# Package / Application
from gdwcalc import (__version__,
__project_url__,
__project_name__,
__description__,
__long_descr__,
)
# ---------------------------------------------------------------------------
### General Setup
# ---------------------------------------------------------------------------
# turn off logging if we're going to build a distribution
logging.disable(logging.CRITICAL)
# ---------------------------------------------------------------------------
### build_exe Setup
# ---------------------------------------------------------------------------
# included packages and their submodules
packages = []
# included modules
includes = []
# Files to include (and their destinations)
include_files = []
# list of names of files to include when determining dependencies of
# binary files that would normally be excluded; note that version
# numbers that normally follow the shared object extension are
# stripped prior to performing the comparison
bin_includes = []
# list of names of modules to exclude
excludes = [
"tkinter",
"ssl",
"pillow",
"pil",
"PyQt4",
"multiprocessing",
"bz2",
"coverage",
"zmq",
]
#mplBackendsPath = os.path.join(os.path.split(sys.executable)[0],
# "Lib\\site-packages\\matplotlib\\backends\\backend_*")
#
#fileList = glob.glob(mplBackendsPath)
#
#moduleList = []
#
#for mod in fileList:
# module = os.path.splitext(os.path.basename(mod))[0]
# if not module in ("backend_wxagg", "backend_wx", "backend_agg"):
# moduleList.append("matplotlib.backends." + module)
#
#excludes += moduleList
# Options for build_exe
build_exe_opts = {
"packages": packages,
"includes": includes,
"include_files": include_files,
"bin_includes": bin_includes,
"excludes": excludes,
"silent": True,
}
# ---------------------------------------------------------------------------
### Executable Definitions
# ---------------------------------------------------------------------------
file_to_build = "gdwcalc\\GDWCalc.py"
# Application Base
base = None
if sys.platform == 'win32': # uncomment this to remove console window.
base = "Win32GUI"
exe1 = Executable(file_to_build,
base=base,
# targetName="PyBank", # Doesn't work :-(
# icon="rsc\\wafer.png",
)
# List of which executables to build.
exes_to_build = [
exe1,
]
# ---------------------------------------------------------------------------
### setup()
# ---------------------------------------------------------------------------
setup(
name=__project_name__,
version=__version__,
description=__description__,
options={"build_exe": build_exe_opts},
executables=exes_to_build,
)