From 7fd1146c77da777970e99d29a0c623c070bd0f95 Mon Sep 17 00:00:00 2001 From: jmht Date: Mon, 20 Jul 2020 09:44:17 +0100 Subject: [PATCH] Updated version handling --- ambuild/ab_cell.py | 6 +++--- ambuild/version.py | 2 ++ setup.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 ambuild/version.py diff --git a/ambuild/ab_cell.py b/ambuild/ab_cell.py index 80c9197..e871d73 100644 --- a/ambuild/ab_cell.py +++ b/ambuild/ab_cell.py @@ -3,7 +3,6 @@ @author: abbietrewin """ -VERSION = "1.0.0" import collections import copy import logging @@ -26,6 +25,7 @@ from ambuild import ab_fragment from ambuild import ab_subunit from ambuild import ab_util +from ambuild.version import __version__ from ambuild import xyz_core from ambuild import xyz_util @@ -128,8 +128,8 @@ def __init__( self.paramsDir = paramsDir # Use the parameters to set the bond lengts in the util module xyz_util.setModuleBondLength(os.path.join(paramsDir, "bond_params.csv")) - self.version = VERSION # Save as attribute so we can query pickle files - logger.info("AMBUILD version: {0}".format(VERSION)) + self.version = __version__ # Save as attribute so we can query pickle files + logger.info("AMBUILD version: {0}".format(self.version)) self.setMdEngineCls(ab_util.HOOMDVERSION) if filePath: self.setStaticBlock(filePath) diff --git a/ambuild/version.py b/ambuild/version.py new file mode 100644 index 0000000..2c3ca06 --- /dev/null +++ b/ambuild/version.py @@ -0,0 +1,2 @@ +__version_info__ = (1, 0, 0) +__version__ = ".".join(map(str, __version_info__)) diff --git a/setup.py b/setup.py index 2f25baf..d73d332 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,12 @@ import setuptools +from ambuild.version import __version__ with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="ambuild", - version="1.0.0", + version=__version__, author="Jens Thomas", author_email="linucks42@gmail.com", description="A program for creating polymeric molecular structures.",