From a31bf6c8b24dbb5f06e2919cbdaede2a47be6828 Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Thu, 10 Nov 2022 13:50:21 -0800 Subject: [PATCH] use scm for version --- matminer/__init__.py | 8 +++++++- setup.py | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/matminer/__init__.py b/matminer/__init__.py index 894cebca0..5733783c1 100644 --- a/matminer/__init__.py +++ b/matminer/__init__.py @@ -1 +1,7 @@ -__version__ = "0.7.8" +from pkg_resources import DistributionNotFound, get_distribution + +try: + __version__ = get_distribution("matminer").version +except DistributionNotFound: # pragma: no cover + # package is not installed + pass diff --git a/setup.py b/setup.py index d5a7b6cf8..60d8d0a46 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,8 @@ if __name__ == "__main__": setup( name='matminer', - version='0.7.8', + use_scm_version=True, + setup_requires=["setuptools_scm"], description='matminer is a library that contains tools for data ' 'mining in Materials Science', long_description=open(os.path.join(module_dir, 'README.md')).read(),