forked from scottrice/Ice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
118 lines (103 loc) · 2.44 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
import os
import re
import sys
import uuid
from distutils.sysconfig import get_python_lib
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
from setuptools import setup, find_packages
def is_windows(platform):
return platform.startswith('win')
def is_mac(platform):
return platform.startswith('darwin')
if "py2exe" in sys.argv:
import py2exe
WINDOWS_SPECIFIC_OPTIONS = dict(
argv_emulation=False,
setup_requires=[
'py2exe',
],
options = dict(
py2exe = {
# TODO: Can we generate this list automatically from requirements.txt?
"includes": [
"appdirs",
"psutil",
],
}
),
)
MAC_SPECIFIC_OPTIONS = dict(
app=[ os.path.join('bin', 'ice.py') ],
setup_requires = [
'py2app',
],
options = dict(
py2app = {
"argv_emulation": True,
"iconfile": "icon.icns",
"includes": [
"appdirs",
"psutil",
],
},
),
)
LINUX_SPECIFIC_OPTIONS = dict(
)
DATA_FILES = [
'config.txt',
'consoles.txt',
'emulators.txt',
]
EXCLUDE_FROM_PACKAGES = [
"tests",
"tests.*",
"*.tests",
"*.tests.*",
]
DEPENDENCY_LINKS = [
]
requirements = [str(ir.req) for ir in parse_requirements('requirements.txt', session=uuid.uuid1())]
def extra_options(platform):
if is_windows(platform):
return WINDOWS_SPECIFIC_OPTIONS
elif is_mac(platform):
return MAC_SPECIFIC_OPTIONS
else:
return LINUX_SPECIFIC_OPTIONS
setup(
name='Ice',
version='0.1.0',
url='http://scottrice.github.io/Ice',
author='Scott Rice',
author_email='[email protected]',
description='An application to automatically add ROMs to Steam as playable games',
long_description=open('README.md').read(),
license='MIT',
packages=find_packages('.', exclude=EXCLUDE_FROM_PACKAGES),
include_package_data=True,
data_files=DATA_FILES,
console=[ os.path.join('ice', '__main__.py') ],
entry_points={'console_scripts': [
]},
dependency_links = DEPENDENCY_LINKS,
install_requires=requirements,
test_suite='nose.collector',
tests_require=[
'nose',
'nose-parameterized',
'mockito',
],
zip_safe=False,
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
**extra_options(sys.platform)
)