forked from sunpy/sunkit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·40 lines (31 loc) · 1.29 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
#!/usr/bin/env python
import os
import sys
from itertools import chain
# Ensure that astropy-helpers is available
import ah_bootstrap # noqa
from astropy_helpers.setup_helpers import get_package_info, register_commands # noqa
from setuptools import setup
from setuptools.config import read_configuration
# Append cwd for pip 19
sys.path.append(os.path.abspath("."))
# Override the default Astropy Test Command
cmdclass = register_commands()
try:
from sunpy.tests.setup_command import SunPyTest
# Overwrite the Astropy Testing framework
cmdclass["test"] = type("SunPyTest", (SunPyTest,), {"package_name": "sunkit_image"})
except Exception:
# Catch everything, if it doesn't work, we still want SunPy to install.
pass
# 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()))
package_info = get_package_info()
setup(extras_require=extras, use_scm_version=True, cmdclass=cmdclass, **package_info)