-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmountwizzard_debug.spec
139 lines (123 loc) · 4.78 KB
/
mountwizzard_debug.spec
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
132
133
134
135
136
137
138
139
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # ####
# ## ## # ## # #
# # # # # # # # # ###
# # ## # ## ## #
# # # # # # ####
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 for python
# Python v3.6.7
#
# Michael Würtenberger
# (c) 2016, 2017, 2018
#
# Licence APL2.0
#
###########################################################
# standard libraries
import os
import sys
# external packages
import astropy
# local import
# remove TK
sys.modules['FixTk'] = None
# define paths
DISTPATH = '../dist'
WORKPATH = '../build'
astropy_path, = astropy.__path__
block_cipher = None
pythonPath = '/Users/astro/Envs/mw3/Lib'
sitePack = pythonPath + '/site-packages'
distDir = '/Users/astro/PycharmProjects/MountWizzard3/dist'
packageDir = '/Users/astro/PycharmProjects/MountWizzard3/mountwizzard3'
importDir = '/Users/astro/PycharmProjects/MountWizzard3'
a = Analysis(['mountwizzard3/mountwizzard3.py'],
pathex=[packageDir],
binaries=[
],
datas=[(astropy_path, 'astropy'),
],
hiddenimports=['shelve',
],
hookspath=[],
runtime_hooks=[],
excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter',
'astropy',
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
)
# remove thing to reduce size and number of files in package (have to be extracted)
a.binaries = [x for x in a.binaries if not x[0].startswith('mpl-data/sample_data')]
a.binaries = [x for x in a.binaries if not x[0].startswith('mpl-data/fonts')]
a.binaries = [x for x in a.binaries if not x[0].startswith('PyQt5/Qt/translations')]
a.binaries = [x for x in a.binaries if not x[0].startswith('QtQuick')]
a.binaries = [x for x in a.binaries if not x[0].startswith('QtQml')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/analytic_functions')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/config.tests')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/constants.tests')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/convolution')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/cosmology')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/samp')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/modeling')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/table')]
a.binaries = [x for x in a.binaries if not x[0].startswith('astropy/vo')]
# same to datas
a.datas = [x for x in a.datas if not x[0].startswith('mpl-data/sample_data')]
a.datas = [x for x in a.datas if not x[0].startswith('mpl-data/fonts')]
a.datas = [x for x in a.datas if not x[0].startswith('PyQt5/Qt/translations')]
a.datas = [x for x in a.datas if not x[0].startswith('QtQuick')]
a.datas = [x for x in a.datas if not x[0].startswith('QtQml')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/analytic_functions')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/config.tests')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/constants.tests')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/convolution')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/cosmology')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/samp')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/modeling')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/table')]
a.datas = [x for x in a.datas if not x[0].startswith('astropy/vo')]
pyz = PYZ(a.pure,
a.zipped_data,
cipher=block_cipher,
)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='MountWizzard3debug',
debug=True,
strip=False,
upx=False,
console=True,
icon='./mountwizzard3/icons/mw.ico',
)
#
# we have to prepare the build as there is an error when overwriting it
# if file present, we have to delete python3 --version
#
sys.path.append(importDir)
from mountwizzard3.build.build import BUILD
BUILD_NO = BUILD.BUILD_NO_FILE
buildFile = distDir + '/MountWizzard3debug.exe'
buildFileNumber = distDir + '/mountwizzard3debug-' + BUILD_NO + '.exe'
print(BUILD_NO)
app = BUNDLE(exe,
name='MountWizzard3debug.exe',
version=3,
icon='./mountwizzard3/icons/mw.ico',
bundle_identifier=None)
#
# we have to prepare the build as there is an error when overwriting it
# if file present, we have to delete it
#
if os.path.isfile(buildFileNumber):
os.remove(buildFileNumber)
print('removed existing app bundle with version number')
os.rename(buildFile, buildFileNumber)