diff --git a/CI/update_version.py b/CI/update_version.py index bf63681..5fcf2c1 100644 --- a/CI/update_version.py +++ b/CI/update_version.py @@ -3,6 +3,8 @@ import subprocess from distutils.version import LooseVersion +import os + def get_version(): p = subprocess.run(["git describe|sed 's/-/.post/'|cut -d'-' -f1"], shell=True, stdout=subprocess.PIPE) @@ -10,8 +12,34 @@ def get_version(): return output def set_version(version): + # modify the files to reflect the new version + files = [os.abspath('./src/msspec/__init__.py'), + os.abspath('./src/msspec/msspecgui/__init__.py')] + + for f in files: + with open(f, "w") as fd: + f.write("# Auto-generated file, do not edit\n") + f.write(f"__version__ = \"{version}\"\n") + f.write(f"__sha__ = \"$Id$\"\n") + + with open(os.abspath("./VERSION"), "w") as fd: + f.write(f"MsSpec-{version}") + + # commit them + files = [os.abspath('./src/msspec/__init__.py'), + os.abspath('./src/msspec/msspecgui/__init__.py'), + os.abspath("./VERSION")] + for f in files: + cmd = ['git', 'add', f] + subprocess.run(cmd) + msg = 'Update version' + cmd = ['git', 'commit', '-m', msg] + subprocess.run(cmd) + + # create the tag cmd = ['git', 'tag', '-a', version, '-m', f"Python MsSpec ({version})"] subprocess.run(cmd) + def ask_new_version(current_version): version = LooseVersion(current_version) diff --git a/VERSION b/VERSION deleted file mode 100644 index aebc9fe..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -MsSpec-1.4post4 diff --git a/src/msspec/__init__.py b/src/msspec/__init__.py index e53b9b1..5a8aed2 100644 --- a/src/msspec/__init__.py +++ b/src/msspec/__init__.py @@ -1 +1 @@ -__version__ = '1.4post4' +__version__ = '1.5post1' diff --git a/src/msspec/msspecgui/__init__.py b/src/msspec/msspecgui/__init__.py index e53b9b1..5a8aed2 100644 --- a/src/msspec/msspecgui/__init__.py +++ b/src/msspec/msspecgui/__init__.py @@ -1 +1 @@ -__version__ = '1.4post4' +__version__ = '1.5post1'