From db7e7adc6b26c6d342a1e6b71afd531397585455 Mon Sep 17 00:00:00 2001 From: Romain Beucher Date: Tue, 18 Aug 2020 14:17:43 +1000 Subject: [PATCH] Up version --- pyFTracks/__init__.py | 3 +++ setup.py | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/pyFTracks/__init__.py b/pyFTracks/__init__.py index 5339dec..03a7295 100644 --- a/pyFTracks/__init__.py +++ b/pyFTracks/__init__.py @@ -6,3 +6,6 @@ from .age_calculations import calculate_ages as single_grain_ages from .age_calculations import chi_square as chi2_test from .thermal_history import ThermalHistory + + +__version__= "0.2.9" diff --git a/setup.py b/setup.py index c6a10cf..9f1bee6 100755 --- a/setup.py +++ b/setup.py @@ -1,11 +1,7 @@ from setuptools import setup, Extension from os import path +import codecs -MAJOR = 0 -MINOR = 2 -MICRO = 8 -ISRELEASED = False -VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) class get_numpy_include(object): """Returns Numpy's include path with lazy import""" @@ -14,6 +10,19 @@ def __str__(self): import numpy return numpy.get_include() +def read(rel_path): + here = path.abspath(path.dirname(__file__)) + with codecs.open(path.join(here, rel_path), 'r') as fp: + return fp.read() + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + # Get the long description from the README file here = path.abspath(path.dirname(__file__)) @@ -33,9 +42,9 @@ def __str__(self): 'numpy', 'cython' ], - version=VERSION, + version=get_version("pyFTracks/__init__.py"), description='Fission Track Modelling and Analysis with Python', - ext_modules=extensions, + ext_modules=get_version("pyFTracks/__init__.py"), include_package_data=True, include_dirs=[get_numpy_include()], long_description=long_description,