-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathsetup.py
116 lines (102 loc) · 3.18 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
"""Use the following command to install retriever: python setup.py install"""
from setuptools import setup
import platform
p = platform.platform().lower()
extra_includes = []
if "darwin" in p:
try: import py2app
except ImportError: pass
extra_includes = []
elif "win" in p:
try: import py2exe
except ImportError: pass
import sys
extra_includes = ['pyodbc', 'inspect']
sys.path.append("C:\\Windows\\winsxs\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91")
from __init__ import VERSION
def clean_version(v):
if v == 'master':
return '1.0.0'
return v.replace('v', '').replace('.rc', '').replace('.beta', '')
packages = [
'retriever.lib',
'retriever.engines',
'retriever.app',
'retriever',
]
includes = [
'xlrd',
'wx',
'pymysql',
'psycopg2',
'sqlite3',
] + extra_includes
excludes = [
'pyreadline',
'doctest',
'optparse',
'getopt',
'pickle',
'calendar',
'pdb',
'inspect',
'email',
'pywin', 'pywin.debugger',
'pywin.debugger.dbgcon',
'pywin.dialogs', 'pywin.dialogs.list',
'Tkconstants', 'Tkinter', 'tcl',
]
setup(name='retriever',
version=clean_version(VERSION),
description='EcoData Retriever',
author='Ben Morris',
author_email='[email protected]',
url='http://www.ecodataretriever.org',
packages=packages,
package_dir={
'retriever':''
},
entry_points={
'console_scripts': [
'retriever = retriever.__main__:main',
],
},
install_requires=[
'xlrd',
],
# py2exe flags
console = [{'script': "__main__.py",
'dest_base': "retriever",
'icon_resources':[(1,'icon.ico')]
}],
zipfile = None,
# py2app flags
app=['__main__.py'],
data_files=[('', ['CITATION'])],
setup_requires=['py2app'] if 'darwin' in p else [],
# options
# optimize is set to 1 of py2app to avoid errors with pymysql
# bundle_files = 1 or 2 was causing failed builds so we moved
# to bundle_files = 3 and Inno Setup
options = {'py2exe': {'bundle_files': 3,
'compressed': 2,
'optimize': 1,
'packages': packages,
'includes': includes,
'excludes': excludes,
},
'py2app': {'packages': ['retriever'],
'includes': includes,
'site_packages': True,
'resources': [],
'optimize': 1,
'argv_emulation': True,
'no_chdir': True,
},
},
)
try:
from compile import compile
compile()
except:
pass