From 82fa1856766ee0df30c5e20c710c2c1d4cadbd21 Mon Sep 17 00:00:00 2001
From: dh00601 <dh00601@surrey.ac.uk>
Date: Sat, 16 Oct 2021 17:03:17 +0100
Subject: [PATCH] updated setup.py to use VERSION

---
 setup.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index cac092170..31e99f7b9 100644
--- a/setup.py
+++ b/setup.py
@@ -13,6 +13,14 @@ import distutils.command.build
 
 # TODO: replace the tasks that call binary_c-config with a single function that handles the return status a bit better.
 
+def version():
+    """
+    opens VERSION and returns version number
+    """
+
+    with open("VERSION") as file:
+        return file.read().strip()
+
 # Functions
 def readme():
     """Opens readme file and returns content"""
@@ -224,7 +232,7 @@ class CustomBuildCommand(distutils.command.build.build):
 
 setup(
     name="binarycpython",
-    version="0.9.1",
+    version=version(),
     description="""This is a python API for binary_c (versions {}) by David Hendriks, Rob Izzard and collaborators. Based on the initial set up by Jeff andrews.""".format(
         ",".join(REQUIRED_BINARY_C_VERSIONS),
         ",".join(REQUIRED_BINARY_C_VERSIONS),
-- 
GitLab