diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 000000000..95cb3eea4 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1 @@ +ref-names: $Format:%D$ diff --git a/pysindy/__init__.py b/pysindy/__init__.py index c86362970..fc73c1218 100644 --- a/pysindy/__init__.py +++ b/pysindy/__init__.py @@ -1,3 +1,11 @@ +from pkg_resources import get_distribution, DistributionNotFound + +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + pass + + from pysindy.pysindy import SINDy from pysindy.differentiation import * from pysindy.optimizers import * diff --git a/requirements-dev.txt b/requirements-dev.txt index 7f51207c9..98bdfde45 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,5 @@ pytest-lazy-fixture pytest-flake8 flake8-builtins-unleashed codecov -pre-commit +setuptools_scm +setuptools_scm_git_archive diff --git a/setup.py b/setup.py index 906f97e8d..a3abdcfbd 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,8 @@ setup( name=NAME, - version="0.0.1", + use_scm_version=True, + setup_requires=["setuptools_scm", "setuptools_scm_git_archive"], description=DESCRIPTION, long_description=LONG_DESCRIPTION, author=AUTHOR,