|
1 | | -import os, sys |
| 1 | +import os |
| 2 | +import sys |
2 | 3 | import shutil |
3 | 4 | from setuptools import setup |
4 | | -import pkg_resources |
5 | 5 |
|
6 | 6 | # build dependencies |
7 | 7 | import pyct.build |
8 | 8 |
|
9 | 9 | # dependencies |
10 | 10 |
|
11 | | -# datashader first, then pyct unless pyct version compatible with ds is specified |
| 11 | +# datashader first, then pyct unless pyct version compatible with ds |
| 12 | +# is specified |
12 | 13 | # spatialpandas may not be required in final pharmacy_desert version |
13 | 14 | # pyct may not be required after pyctdev is released |
14 | 15 | install_requires = [ |
|
22 | 23 | 'scipy', |
23 | 24 | 'xarray', |
24 | 25 | 'pyct <=0.4.6', |
25 | | - ] |
| 26 | +] |
26 | 27 |
|
27 | 28 | examples = [ |
28 | | - 'spatialpandas', |
| 29 | + 'spatialpandas', |
29 | 30 | ] |
30 | 31 |
|
31 | 32 | # Additional tests dependencies and examples_extra may be needed in the future |
32 | 33 | extras_require = { |
33 | | - 'tests': [ |
34 | | - 'pytest', |
35 | | - ], |
36 | | - 'examples': examples, |
| 34 | + 'tests': [ |
| 35 | + 'pytest', |
| 36 | + ], |
| 37 | + 'examples': examples, |
37 | 38 | } |
38 | 39 |
|
39 | 40 | # additional doc dependencies may be needed |
|
44 | 45 | # metadata for setuptools |
45 | 46 |
|
46 | 47 | setup_args = dict( |
47 | | - name='xarray-spatial', |
48 | | - use_scm_version={ |
49 | | - "write_to": "xrspatial/_version.py", |
50 | | - "write_to_template": '__version__ = "{version}"', |
51 | | - "tag_regex": r"^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$", |
52 | | - }, |
53 | | - description='xarray-based spatial analysis tools', |
54 | | - install_requires=install_requires, |
55 | | - extras_require=extras_require, |
56 | | - tests_require=extras_require['tests'], |
57 | | - zip_safe=False, |
58 | | - classifiers=["Programming Language :: Python :: 3", |
59 | | - "License :: OSI Approved :: MIT License", |
60 | | - "Operating System :: OS Independent"], |
61 | | - packages=['xrspatial', |
62 | | - 'xrspatial.tests' |
63 | | - ], |
64 | | - include_package_data=True, |
65 | | - entry_points={ |
66 | | - 'console_scripts': [ |
67 | | - 'xrspatial = xrspatial.__main__:main' |
68 | | - ] |
69 | | - }, |
| 48 | + name='xarray-spatial', |
| 49 | + use_scm_version={ |
| 50 | + 'write_to': 'xrspatial/_version.py', |
| 51 | + 'write_to_template': '__version__ = "{version}"', |
| 52 | + 'tag_regex': r'^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$', |
| 53 | + }, |
| 54 | + description='xarray-based spatial analysis tools', |
| 55 | + install_requires=install_requires, |
| 56 | + extras_require=extras_require, |
| 57 | + tests_require=extras_require['tests'], |
| 58 | + zip_safe=False, |
| 59 | + classifiers=['Programming Language :: Python :: 3', |
| 60 | + 'License :: OSI Approved :: MIT License', |
| 61 | + 'Operating System :: OS Independent'], |
| 62 | + packages=['xrspatial', |
| 63 | + 'xrspatial.tests' |
| 64 | + ], |
| 65 | + include_package_data=True, |
| 66 | + entry_points={ |
| 67 | + 'console_scripts': [ |
| 68 | + 'xrspatial = xrspatial.__main__:main' |
| 69 | + ] |
| 70 | + }, |
70 | 71 | ) |
71 | 72 |
|
72 | 73 | if __name__ == '__main__': |
73 | | - example_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), |
74 | | - 'xarray-spatial', 'examples') |
75 | | - if 'develop' not in sys.argv: |
76 | | - pyct.build.examples(example_path, __file__, force=True) |
77 | | - setup(**setup_args) |
78 | | - |
79 | | - if os.path.isdir(example_path): |
80 | | - shutil.rmtree(example_path) |
| 74 | + example_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), |
| 75 | + 'xarray-spatial', 'examples') |
| 76 | + if 'develop' not in sys.argv: |
| 77 | + pyct.build.examples(example_path, __file__, force=True) |
| 78 | + setup(**setup_args) |
| 79 | + |
| 80 | + if os.path.isdir(example_path): |
| 81 | + shutil.rmtree(example_path) |
0 commit comments