forked from ratt-ru/codex-africanus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
93 lines (79 loc) · 2.81 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import os
from pathlib import Path
from setuptools import setup, find_packages
# Import requirements
# requirements
on_rtd = os.environ.get('READTHEDOCS') == 'True'
# Basic requirements containing no C extensions.
# This is necessary for building on RTD
requirements = ['appdirs >= 1.4.3',
'decorator']
if not on_rtd:
requirements += [
# astropy breaks with numpy 1.15.3
# https://github.com/astropy/astropy/issues/7943
'numpy >= 1.14.0, != 1.15.3',
'numba >= 0.49.0'
]
extras_require = {
'cuda': ['cupy >= 5.0.0', 'jinja2 >= 2.10'],
'dask': ['dask[array] >= 1.1.0'],
'jax': ['jax == 0.1.68', 'jaxlib == 0.1.47'],
'scipy': ['scipy >= 1.4.0'],
'astropy': ['astropy >= 3.0'],
'python-casacore': ['python-casacore >= 3.3.1'],
'ducc0': ['ducc0 >= 0.8.0'],
'testing': ['pytest', 'flaky', 'pytest-flake8 >= 1.0.6']
}
with open(str(Path("africanus", "install", "extras_require.py")), "w") as f:
f.write("extras_require = {\n")
for k, v in extras_require.items():
f.write(" '%s': %s,\n" % (k, v))
f.write("}\n")
_non_cuda_extras = [er for n, er in extras_require.items() if n != "cuda"]
_all_extras = extras_require.values()
extras_require['complete'] = sorted(set(sum(_non_cuda_extras, [])))
extras_require['complete-cuda'] = sorted(set(sum(_all_extras, [])))
setup_requirements = []
test_requirements = (extras_require['testing'] +
extras_require['astropy'] +
extras_require['python-casacore'] +
extras_require['dask'] +
extras_require['scipy'] +
extras_require['ducc0'])
with open('README.rst') as readme_file:
readme = readme_file.read()
setup(
author="Simon Perkins",
author_email='[email protected]',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
description="Radio Astronomy Building Blocks",
extras_require=extras_require,
install_requires=requirements,
license="BSD-3-Clause",
long_description=readme,
long_description_content_type='text/x-rst',
include_package_data=True,
keywords='codex-africanus',
name='codex-africanus',
packages=find_packages(),
python_requires=">=3.6",
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/ska-sa/codex-africanus',
version='0.2.9',
zip_safe=False,
)