diff --git a/MANIFEST.in b/MANIFEST.in index 0fe0cbd..662cf49 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include *.txt include *.md +include mapshader/.version graft mapshader diff --git a/mapshader/__init__.py b/mapshader/__init__.py index 5546248..378f407 100644 --- a/mapshader/__init__.py +++ b/mapshader/__init__.py @@ -1,9 +1,13 @@ import sys -try: - from ._version import __version__ -except ImportError: - __version__ = "Unknown" +import param +__version__ = str( + param.version.Version( + fpath=__file__, + archive_commit='$Format:%h$', + reponame='mapshader', + ) +) def test(): diff --git a/pyproject.toml b/pyproject.toml index a207dee..b255363 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [build-system] requires = [ + 'param >=1.6.1', 'pyct', 'setuptools', 'wheel', diff --git a/setup.py b/setup.py index 245c8cd..5ef236c 100644 --- a/setup.py +++ b/setup.py @@ -3,16 +3,17 @@ import shutil import sys +import param import pyct.build setup_args = dict( name='mapshader', - use_scm_version={ - 'write_to': 'mapshader/_version.py', - 'write_to_template': '__version__ = "{version}"', - 'tag_regex': r'^(?Pv)?(?P[^\+]+)(?P.*)?$', - }, + version=param.version.get_setup_version( + __file__, + 'mapshader', + archive_commit='$Format:%h$', + ), description='Simple Python GIS Web Services', url='https://github.com/makepath/mapshader', packages=[ @@ -34,6 +35,7 @@ 'descartes', 'flask', 'flask-cors>=3.0.10', + 'param >=1.6.1', 'rasterio', 'jupyter', 'pyarrow',