File tree Expand file tree Collapse file tree 4 files changed +12
-40
lines changed
Expand file tree Collapse file tree 4 files changed +12
-40
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ install_requires =
2424 xarray
2525packages = find:
2626python_requires = >=3.7
27+ setup_requires = setuptools_scm
2728zip_safe = False
2829
2930[options.entry_points]
Original file line number Diff line number Diff line change 22import shutil
33import sys
44
5- import param
65import pyct .build
76from setuptools import setup
87
9- version = param .version .get_setup_version (
10- __file__ ,
11- 'xarray-spatial' ,
12- pkgname = 'xrspatial' ,
13- archive_commit = "$Format:%h$" ,
14- )
15-
16- if 'sdist' in sys .argv and 'bdist_wheel' in sys .argv :
17- try :
18- version_test = version .split ('.post' )[1 ]
19- version = version .split ('.post' )[0 ]
20- except IndexError :
21- version = version .split ('+' )[0 ]
22- if version is None :
23- sys .exit ('invalid version' )
24-
258
269if __name__ == '__main__' :
2710 example_path = os .path .join (os .path .dirname (os .path .abspath (__file__ )),
2811 'xrspatial' , 'examples' )
2912 if 'develop' not in sys .argv :
3013 pyct .build .examples (example_path , __file__ , force = True )
31- setup (version = version )
14+
15+ use_scm = {
16+ "write_to" : "xrspatial/_version.py"
17+ }
18+
19+ setup (use_scm_version = use_scm )
3220
3321 if os .path .isdir (example_path ):
3422 shutil .rmtree (example_path )
Original file line number Diff line number Diff line change 1- import param
2-
31from xrspatial .aspect import aspect # noqa
42from xrspatial .bump import bump # noqa
53from xrspatial .classify import binary # noqa
3533from xrspatial .zonal import stats as zonal_stats # noqa
3634from xrspatial .zonal import suggest_zonal_canvas as suggest_zonal_canvas # noqa
3735
38- __version__ = str (
39- param .version .Version (
40- fpath = __file__ ,
41- archive_commit = '$Format:%h$' ,
42- reponame = 'xrspatial' ,
43- )
44- )
36+
37+ try :
38+ from ._version import version as __version__
39+ except ImportError :
40+ __version__ = "unknown"
4541
4642
4743def test ():
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments