move version string into module

This commit is contained in:
Alok Saldanha
2020-06-11 13:43:06 -04:00
parent da99abdd9f
commit 804ea29f36
2 changed files with 22 additions and 2 deletions
+2
View File
@@ -6,3 +6,5 @@
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License.
__version__ = "0.2.0"
+20 -2
View File
@@ -1,5 +1,23 @@
import os
from setuptools import setup
import codecs
from setuptools import find_packages, setup
import sys
if sys.version_info < (3,6):
sys.exit('Sorry, Python < 3.6 is not supported')
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
def parse_requirements():
reqs = []
@@ -17,7 +35,7 @@ setup(
# mandatory
name="cellxgene-gateway",
# mandatory
version="0.2.0",
version=get_version("cellxgene_gateway/__init__.py"),
# mandatory
author="Niket Patel, Yohann Potier, Alok Saldanha",
author_email="alok.saldanha@novartis.com",