diff options
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -3,19 +3,25 @@ from setuptools import setup, find_packages from codecs import open from os import path -import numpy from setuptools.extension import Extension from Cython.Build import cythonize - +import numpy +import re +import os here = path.abspath(path.dirname(__file__)) -import os + #import glob -version='0.1.5' +# dirty but working +__version__ = re.search( + r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', # It excludes inline comment too + open('ot/__init__.py').read()).group(1) +# The beautiful part is, I don't even need to check exceptions here. +# If something messes up, let the build process fail noisy, BEFORE my release! ROOT = os.path.abspath(os.path.dirname(__file__)) @@ -29,7 +35,7 @@ except (IOError, ImportError): setup(name='POT', - version=version, + version=__version__, description='Python Optimal Transport Library', long_description=README, author=u'Remi Flamary, Nicolas Courty', @@ -43,7 +49,7 @@ setup(name='POT', language="c++", # generate and compile C++ code, include_dirs=[numpy.get_include(),os.path.join(ROOT,'ot/lp')])), platforms=['linux','macosx','windows'], - download_url='https://github.com/rflamary/POT/archive/V{}.tar.gz'.format(version), + download_url='https://github.com/rflamary/POT/archive/V{}.tar.gz'.format(__version__), license = 'MIT', scripts=[], data_files=[], |