forked from coala/coala-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·167 lines (129 loc) · 4.94 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/env python3
import locale
import os
import platform
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
try:
lc = locale.getlocale()
pf = platform.system()
if pf != 'Windows' and lc == (None, None):
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
except (ValueError, UnicodeError, locale.Error):
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
VERSION = '0.4.0'
DEPENDENCY_LINKS = []
SETUP_COMMANDS = {}
def set_python_path(path):
if 'PYTHONPATH' in os.environ:
user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
user_paths.insert(0, path)
os.environ['PYTHONPATH'] = os.pathsep.join(user_paths)
else:
os.environ['PYTHONPATH'] = path
class PyTestCommand(TestCommand):
"""
From https://pytest.org/latest/goodpractices.html
"""
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
SETUP_COMMANDS['test'] = PyTestCommand
__dir__ = os.path.dirname(__file__)
def read_requirements(filename):
"""
Parse a requirements file.
Accepts vcs+ links, and places the URL into
`DEPENDENCY_LINKS`.
:return: list of str for each package
"""
data = []
filename = os.path.join(__dir__, filename)
with open(filename) as requirements:
required = requirements.read().splitlines()
for line in required:
if not line or line.startswith('#'):
continue
if '+' in line[:4]:
repo_link, egg_name = line.split('#egg=')
if not egg_name:
raise ValueError('Unknown requirement: {0}'
.format(line))
DEPENDENCY_LINKS.append(line)
line = egg_name.replace('-', '==')
data.append(line)
return data
required = read_requirements('requirements.txt')
test_required = read_requirements('test-requirements.txt')
filename = os.path.join(__dir__, 'README.rst')
with open(filename) as readme:
long_description = readme.read()
extras_require = None
EXTRAS_REQUIRE = {}
data_files = None
if extras_require:
EXTRAS_REQUIRE = extras_require
SETUP_COMMANDS.update({
})
if __name__ == '__main__':
setup(name='coala-quickstart',
version=VERSION,
description='A quickstart tool for coala',
author='The coala developers',
author_email='[email protected]',
maintainer='Satwik Kansal, '
'Adrian Zatreanu, '
'Alexandros Dimos, '
'Adhityaa Chandrasekar',
maintainer_email=('[email protected], '
url='https://github.com/coala/coala-quickstart',
platforms='any',
packages=find_packages(exclude=('build.*', 'tests', 'tests.*')),
install_requires=required,
extras_require=EXTRAS_REQUIRE,
tests_require=test_required,
dependency_links=DEPENDENCY_LINKS,
package_data={'coala_quickstart': ['VERSION']},
license='AGPL-3.0',
data_files=data_files,
long_description=long_description,
entry_points={
'console_scripts': [
'coala-quickstart = coala_quickstart.coala_quickstart:main',
],
},
# from http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License '
'v3 or later (AGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Text Processing :: Linguistic'],
cmdclass=SETUP_COMMANDS,
)