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(),