-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
60 lines (47 loc) · 1.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
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ''
def run_tests(self):
import shlex
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
base_dir = os.path.dirname(__file__)
about = {}
with open(os.path.join(base_dir, 'setuptools_scm_about', '__about__.py')) as f:
exec(f.read(), about)
REQUIREMENTS = [
'setuptools_scm>=1.10.0'
]
TEST_REQUIREMENTS = [
'pytest'
]
CI_REQUIREMENTS = TEST_REQUIREMENTS + [
'codecov',
'docutils',
'flake8',
'pygments',
'pytest-cov'
]
setup(
version=about['__version__'],
install_requires=REQUIREMENTS,
tests_require=TEST_REQUIREMENTS,
extras_require={
'tests': TEST_REQUIREMENTS,
'ci': CI_REQUIREMENTS
},
entry_points={
'setuptools_scm.parse_scm_fallback': [
'. = setuptools_scm_about:parse'
]
},
cmdclass={'test': PyTest}
)