summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2016-10-31 09:56:15 +0100
committerRémi Flamary <remi.flamary@gmail.com>2016-10-31 09:56:15 +0100
commit3f5189f8c3c0230bc10fc1c90349c5c340fe808a (patch)
tree64fa75a98b460f30cb2fc2c5a54089eef7f6e05a /setup.py
parent03120093e2c3ce699b18812881a988335f8d8350 (diff)
better version handling
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 70a85c2..9804422 100755
--- a/setup.py
+++ b/setup.py
@@ -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=[],