diff --git a/README.md b/README.md index d58276e..23a52d7 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,12 @@ For this project we are using [semantic versioning](http://semver.org/). If you want to make a new release: 1. Create a new tag in git using the following format: `v..`. + + git tag v1.x.0 + git push --tags + 2. Create a release on GitHub based on that tag. Specify changes that were made. + https://github.com/metabrainz/brainzutils-python/releases/new When updating underlying dependencies keep in mind breaking changes that they might have. Update version of `brainzutils-python` accordingly. diff --git a/brainzutils/__init__.py b/brainzutils/__init__.py index c162747..6aa2012 100644 --- a/brainzutils/__init__.py +++ b/brainzutils/__init__.py @@ -1 +1,7 @@ -__version__ = '1.14.1' +from pkg_resources import get_distribution, DistributionNotFound + +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + pass diff --git a/setup.py b/setup.py index 37bbbd9..7628b60 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,15 @@ #!/usr/bin/env python from setuptools import setup, find_packages -from brainzutils import __version__ setup( name="brainzutils", - version=__version__, description="Python tools for MetaBrainz projects", author="MetaBrainz Foundation", author_email="support@metabrainz.org", py_modules=["brainzutils"], packages=find_packages(), + use_scm_version=True, + setup_requires=['setuptools_scm'], install_requires=open("requirements.txt").read().split(), )