From ac70d3da21c4e81d253a2063b67dceca25d7aa0b Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 9 Sep 2015 09:28:42 +0100 Subject: [PATCH 1/3] [version] handling version in a file --- GPy/VERSION | 1 + GPy/__init__.py | 3 ++- setup.cfg | 3 +-- setup.py | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 GPy/VERSION diff --git a/GPy/VERSION b/GPy/VERSION new file mode 100644 index 00000000..a3df0a69 --- /dev/null +++ b/GPy/VERSION @@ -0,0 +1 @@ +0.8.0 diff --git a/GPy/__init__.py b/GPy/__init__.py index 34baf7d7..88e73d8c 100644 --- a/GPy/__init__.py +++ b/GPy/__init__.py @@ -21,7 +21,8 @@ from . import plotting from .core import Model from .core.parameterization import Param, Parameterized, ObsAr -__version__ = '0.8.0' +with open('VERSION', 'r') as f: + __version__ = f.read() #@nottest try: diff --git a/setup.cfg b/setup.cfg index 73d18f56..e08cd251 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,5 +3,4 @@ current_version = 0.8.0 tag = True commit = True -[bumpversion:file:setup.py] -[bumpversion:file:GPy/__init__.py] +[bumpversion:file:GPy/VERSION] diff --git a/setup.py b/setup.py index d25dc242..49144a69 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,11 @@ import sys from setuptools import setup, Extension import numpy as np -# Version number -__version__ = '0.8.0' - def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() +__version__ = read('GPy/VERSION') + #Mac OS X Clang doesn't support OpenMP th the current time. #This detects if we are building on a Mac def ismac(): @@ -72,7 +71,8 @@ setup(name = 'GPy', package_dir={'GPy': 'GPy'}, package_data = {'GPy': ['defaults.cfg', 'installation.cfg', 'util/data_resources.json', - 'util/football_teams.json']}, + 'util/football_teams.json', + 'VERSION']}, include_package_data = True, py_modules = ['GPy.__init__'], test_suite = 'GPy.testing', From 3c2ea9033a44539247f814f7f5d2bedd53641239 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 9 Sep 2015 09:45:01 +0100 Subject: [PATCH 2/3] [version] controlling the version from __version__.py using bumpversion and setup.cfg --- GPy/VERSION | 1 - GPy/__init__.py | 3 +-- setup.cfg | 2 +- setup.py | 7 +++++-- 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 GPy/VERSION diff --git a/GPy/VERSION b/GPy/VERSION deleted file mode 100644 index a3df0a69..00000000 --- a/GPy/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.8.0 diff --git a/GPy/__init__.py b/GPy/__init__.py index 88e73d8c..5f2a209f 100644 --- a/GPy/__init__.py +++ b/GPy/__init__.py @@ -21,8 +21,7 @@ from . import plotting from .core import Model from .core.parameterization import Param, Parameterized, ObsAr -with open('VERSION', 'r') as f: - __version__ = f.read() +from .__version__ import __version__ #@nottest try: diff --git a/setup.cfg b/setup.cfg index e08cd251..5c2a81c0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,4 +3,4 @@ current_version = 0.8.0 tag = True commit = True -[bumpversion:file:GPy/VERSION] +[bumpversion:file:GPy/__version__.py] diff --git a/setup.py b/setup.py index 49144a69..60d58ad8 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,10 @@ import numpy as np def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -__version__ = read('GPy/VERSION') +version_dummy = {} +exec(read('GPy/__version__.py'), version_dummy) +__version__ = version_dummy['__version__'] +del version_dummy #Mac OS X Clang doesn't support OpenMP th the current time. #This detects if we are building on a Mac @@ -72,7 +75,7 @@ setup(name = 'GPy', package_data = {'GPy': ['defaults.cfg', 'installation.cfg', 'util/data_resources.json', 'util/football_teams.json', - 'VERSION']}, + ]}, include_package_data = True, py_modules = ['GPy.__init__'], test_suite = 'GPy.testing', From 2032493317a3a1a07557dfb2d70752938cfd2f5e Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 9 Sep 2015 09:49:15 +0100 Subject: [PATCH 3/3] [version] controlling the version from __version__.py using bumpversion and setup.cfg --- GPy/__version__.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 GPy/__version__.py diff --git a/GPy/__version__.py b/GPy/__version__.py new file mode 100644 index 00000000..777f190d --- /dev/null +++ b/GPy/__version__.py @@ -0,0 +1 @@ +__version__ = "0.8.0"