From 960a954e023ee593f3a0f7efd76bf00475ec60e8 Mon Sep 17 00:00:00 2001 From: Sylvain Tricot Date: Fri, 15 Nov 2019 16:54:08 +0100 Subject: [PATCH] Work on CI --- CI/update_version.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/CI/update_version.py b/CI/update_version.py index 5fcf2c1..5230a67 100644 --- a/CI/update_version.py +++ b/CI/update_version.py @@ -13,22 +13,20 @@ def get_version(): 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')] + files = [os.path.abspath('./src/msspec/__init__.py'), + os.path.abspath('./src/msspec/msspecgui/__init__.py'), + os.path.abspath("./VERSION")] - for f in files: + for f in files[:-1]: 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") + fd.write("# Auto-generated file, do not edit\n") + fd.write(f"__version__ = \"{version}\"\n") + fd.write(f"__sha__ = \"$Id$\"\n") - with open(os.abspath("./VERSION"), "w") as fd: - f.write(f"MsSpec-{version}") + with open(files[-1], "w") as fd: + fd.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)