diff --git a/setup.py b/setup.py index 7902a83..1338615 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,27 @@ #!/usr/bin/env python from distutils.core import setup +import subprocess + +def _get_version_hash(): + """Talk to git and find out the tag/hash of our latest commit""" + try: + p = subprocess.Popen(["git", "describe", + "--tags", "--dirty", "--always"], + stdout=subprocess.PIPE) + except EnvironmentError: + print("Couldn't run git to get a version number for setup.py") + return + ver = p.communicate()[0] + return ver.strip() + setup(name='pymust', version='0.1.2', description='Python port of the MUST toolbox for ultrasound signal processing and generation of simulated images.', author='Gabriel Bernardino (Python port), Damien Garcia (original matlab code)', author_email='gabriel.bernardino1@gmail.com', url='https://www.biomecardio.com/en//', + version=_get_version_hash(), packages=['pymust'], license = 'GNU Lesser General Public License v3.0 (LGPL v3)', package_dir={'':'src'}