forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·64 lines (51 loc) · 2.17 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
#!/usr/bin/env python
import sys
################################################################################
# Raise helpful messages for test and build_docs commands
################################################################################
test_help = """\
Running tests is no longer done using 'python setup.py test'.
Instead you will need to run:
tox -e offline
if you don't already have tox installed, you can install it with:
pip install tox
if you only want to run part of the test suite, you can also use pytest directly with:
pip install -e .[dev]
pytest
for more information, see:
https://docs.sunpy.org/en/latest/dev_guide/tests.html
"""
if 'test' in sys.argv:
print(test_help)
sys.exit(1)
docs_help = """\
Building the documentation is no longer done using 'python setup.py build_docs'.
Instead you will need to run:
tox -e build_docs
if you don't already have tox installed, you can install it with:
pip install tox
for more information, see:
https://docs.sunpy.org/en/latest/dev_guide/documentation.html#usage
"""
if 'build_docs' in sys.argv or 'build_sphinx' in sys.argv:
print(docs_help)
sys.exit(1)
################################################################################
# Actual setup.py content
################################################################################
from itertools import chain
from setuptools import setup
from setuptools.config import read_configuration
from extension_helpers import get_extensions
################################################################################
# Programmatically generate some extras combos.
################################################################################
extras = read_configuration("setup.cfg")['options']['extras_require']
# Dev is everything
extras['dev'] = list(chain(*extras.values()))
# All is everything but tests and docs
exclude_keys = ("tests", "docs", "dev")
ex_extras = dict(filter(lambda i: i[0] not in exclude_keys, extras.items()))
# Concatenate all the values together for 'all'
extras['all'] = list(chain.from_iterable(ex_extras.values()))
setup(extras_require=extras, use_scm_version=True, ext_modules=get_extensions())