-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
126 lines (108 loc) · 4.24 KB
/
setup.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
# -*- coding: utf-8 -*-
'''
Written by Daniel M. Aukes and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
'''
#from setuptools import setup
from cx_Freeze import setup, Executable
import sys
import shutil
import os
import importlib
import idealab_tools.setup_tools as st
sys.path.append('./python')
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)
shutil.rmtree('empty_gui.egg-info', ignore_errors=True)
packages = []
packages.append('empty_gui')
package_data = {}
package_data['empty_gui'] = ['files/*']
includes = []
includes.append('PyQt5')
excludes = []
excludes.append('tcl')
excludes.append('tk')
#excludes.append('numpy')
#excludes.append('scipy')
#excludes.append('babel')
#excludes.append('matplotlib')
#excludes.append('gtk')
#excludes.append('_gtkagg')
#excludes.append('_tkagg')
#excludes.append('bsddb')
#excludes.append('curses')
#excludes.append('pywin.debugger')
#excludes.append('pywin.debugger.dbgcon')
#excludes.append('pywin.dialogs')
#excludes.append('Tkconstants')
#excludes.append('Tkinter')
#excludes.append('babel')
#excludes.append('notebook')
#excludes.append('spyder')
#excludes.append('ipython')
#excludes.append('jupyter_client')
#excludes.append('jupyter_core')
zip_includes = []
include_files = []
include_files.extend(st.include_entire_directory(st.fix(st.python_installed_directory,'Library/plugins/platforms'),''))
#include_files.extend(st.include_entire_directory(st.fix(st.python_installed_directory,'Library/bin'),''))
# regular python
# include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Widgets.dll'),'Library/bin/Qt5Widgets.dll'))
# include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Core.dll'),'Library/bin/Qt5Core.dll'))
# include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Gui.dll'),'Library/bin/Qt5Gui.dll'))
#anaconda python
include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Widgets_conda.dll'),'Library/bin/Qt5Widgets_conda.dll'))
include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Core_conda.dll'),'Library/bin/Qt5Core_conda.dll'))
include_files.append((st.fix(st.python_installed_directory,'Library/bin/Qt5Gui_conda.dll'),'Library/bin/Qt5Gui_conda.dll'))
build_exe_options = {}
build_exe_options['packages']=packages
build_exe_options['includes']=includes
build_exe_options['excludes']=excludes
build_exe_options["include_files"]=include_files
build_exe_options["zip_includes"]=zip_includes
build_exe_options['include_msvcr']=True
bdist_msi_options = {}
#import uuid
#bdist_msi_options['upgrade_code']= str(uuid.uuid4())
bdist_msi_options['upgrade_code']= '6576a015-5ff7-4cf8-bc8c-297b139cf5ae'
exe = Executable(
# what to build
script = "python/empty_gui/main_app.py", # the name of your main python script goes here
initScript = None,
base = "Win32GUI", # if creating a GUI instead of a console app, type "Win32GUI", otherwise, None
#targetName = "Hello World.exe", # this is the name of the executable file
#copyDependentFiles = True,
#compress = False,
#appendScriptToExe = True,
#appendScriptToLibrary = True,
icon = 'python/empty_gui/files/logo_4_1_icon.ico', # if you want to use an icon file, specify the file name here
shortcutDir="ProgramMenuFolder",
shortcutName='empty_gui',
)
#executables = []
#executables.append(exe)
setup_options = {}
setup_options['build_exe']=build_exe_options
setup_options['bdist_msi']=bdist_msi_options
setup_kwargs = {}
setup_kwargs['name']='empty_gui'
setup_kwargs['version']='0.0.1'
setup_kwargs['classifiers']=['Programming Language :: Python','Programming Language :: Python :: 3']
setup_kwargs['description']='Empty QT Project developed by Dan Aukes.'
setup_kwargs['author']='Dan Aukes'
setup_kwargs['author_email']='danaukes@gmail.com'
setup_kwargs['url']=''
setup_kwargs['license']='MIT'
setup_kwargs['packages']=packages
setup_kwargs['package_dir']={'empty_gui' : 'python/empty_gui'}
setup_kwargs['package_data'] = package_data
setup_kwargs['install_requires']=[]
setup_kwargs['options'] = setup_options
setup_kwargs['executables'] = [exe]
module = importlib.import_module('tcl')
p = list(module.__path__)[0]
os.environ['TCL_LIBRARY'] = p
os.environ['TK_LIBRARY'] = p
setup(**setup_kwargs)