|
1 | 1 | import os |
| 2 | +import param |
| 3 | +import pyct.build |
2 | 4 | import sys |
3 | 5 | import shutil |
4 | 6 | from setuptools import setup |
5 | 7 |
|
6 | 8 |
|
7 | | -# build dependencies |
8 | | -import pyct.build |
9 | | -import param |
10 | | - |
11 | | -# dependencies |
12 | | - |
13 | | -# datashader first, then pyct unless pyct version compatible with ds |
14 | | -# is specified |
15 | | -# spatialpandas may not be required in final pharmacy_desert version |
16 | | -# pyct may not be required after pyctdev is released |
17 | | -install_requires = [ |
18 | | - 'dask', |
19 | | - 'datashader', |
20 | | - 'numba', |
21 | | - 'pandas', |
22 | | - 'pillow', |
23 | | - 'requests', |
24 | | - 'xarray', |
25 | | - 'pyct <=0.4.6', |
26 | | - 'param >=1.6.1', |
27 | | - 'distributed >=2021.03.0', |
28 | | -] |
29 | | - |
30 | | -examples = [ |
31 | | -] |
32 | | - |
33 | | -# Additional tests dependencies and examples_extra may be needed in the future |
34 | | -extras_require = { |
35 | | - 'tests': [ |
36 | | - 'pytest', |
37 | | - 'noise >=1.2.2', |
38 | | - ], |
39 | | - 'examples': examples, |
40 | | - 'optional': [ |
41 | | - # Optional for polygonize return types. |
42 | | - 'awkward>=1.4', |
43 | | - 'geopandas', |
44 | | - 'shapely', |
45 | | - 'spatialpandas', |
46 | | - # Optional for gpu_rtx functions. Also requires cupy. |
47 | | - "rtxpy", |
48 | | - ], |
49 | | - 'docs': [ |
50 | | - 'geopandas', |
51 | | - 'Jinja2 >=2.11', |
52 | | - 'ipykernel', |
53 | | - 'matplotlib', |
54 | | - 'nbsphinx', |
55 | | - 'numpydoc', |
56 | | - 'pandoc', |
57 | | - 'pydata_sphinx_theme', |
58 | | - 'sphinx', |
59 | | - 'sphinx-multiversion', |
60 | | - 'sphinx-panels', |
61 | | - 'sphinx_rtd_theme', |
62 | | - ], |
63 | | -} |
64 | | - |
65 | | -extras_require['all'] = sorted(set(sum(extras_require.values(), []))) |
66 | | - |
67 | | -version = param.version.get_setup_version(__file__, 'xarray-spatial', |
68 | | - pkgname='xrspatial', |
69 | | - archive_commit="$Format:%h$") |
| 9 | +version = param.version.get_setup_version( |
| 10 | + __file__, |
| 11 | + 'xarray-spatial', |
| 12 | + pkgname='xrspatial', |
| 13 | + archive_commit="$Format:%h$", |
| 14 | +) |
70 | 15 |
|
71 | 16 | if 'sdist' in sys.argv and 'bdist_wheel' in sys.argv: |
72 | 17 | try: |
|
78 | 23 | sys.exit('invalid version') |
79 | 24 |
|
80 | 25 |
|
81 | | -# metadata for setuptools |
82 | | - |
83 | | -setup_args = dict( |
84 | | - name='xarray-spatial', |
85 | | - version=version, |
86 | | - description='xarray-based spatial analysis tools', |
87 | | - install_requires=install_requires, |
88 | | - extras_require=extras_require, |
89 | | - tests_require=extras_require['tests'], |
90 | | - zip_safe=False, |
91 | | - classifiers=['Programming Language :: Python :: 3', |
92 | | - 'License :: OSI Approved :: MIT License', |
93 | | - 'Operating System :: OS Independent'], |
94 | | - packages=['xrspatial', |
95 | | - 'xrspatial.tests' |
96 | | - ], |
97 | | - include_package_data=True, |
98 | | - entry_points={ |
99 | | - 'console_scripts': [ |
100 | | - 'xrspatial = xrspatial.__main__:main' |
101 | | - ] |
102 | | - }, |
103 | | -) |
104 | | - |
105 | | - |
106 | 26 | if __name__ == '__main__': |
107 | 27 | example_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), |
108 | 28 | 'xrspatial', 'examples') |
109 | 29 | if 'develop' not in sys.argv: |
110 | 30 | pyct.build.examples(example_path, __file__, force=True) |
111 | | - setup(**setup_args) |
| 31 | + setup(version=version) |
112 | 32 |
|
113 | 33 | if os.path.isdir(example_path): |
114 | 34 | shutil.rmtree(example_path) |
0 commit comments