Ver Fonte

infer version

justheuristic há 5 anos atrás
pai
commit
37eb6dde36
3 ficheiros alterados com 14 adições e 2 exclusões
  1. 1 1
      docs/conf.py
  2. 11 1
      setup.py
  3. 2 0
      tesseract/__init__.py

+ 1 - 1
docs/conf.py

@@ -29,7 +29,7 @@ copyright = '2020, Learning@home & contributors'
 author = 'Learning@home & contributors'
 
 # The short X.Y version
-version = ''
+version = tesseract.__version__
 # The full version, including alpha/beta/rc tags
 release = 'latest'
 branch = 'master'

+ 11 - 1
setup.py

@@ -1,12 +1,22 @@
 from pkg_resources import parse_requirements
 from setuptools import setup
+import codecs
+import re
+import os
+
+here = os.path.abspath(os.path.dirname(__file__))
 
 with open('requirements.txt') as requirements_file:
     install_requires = [str(requirement) for requirement in parse_requirements(requirements_file)]
 
+# loading version from setup.py
+with codecs.open(os.path.join(here, 'tesseract/__init__.py'), encoding='utf-8') as init_file:
+    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", init_file.read(), re.M)
+    version_string = version_match.group(1)
+
 setup(
     name='tesseract',
-    version='0.7',
+    version=version_string,
     description='',
     long_description='',
     author='Learning@home authors',

+ 2 - 0
tesseract/__init__.py

@@ -2,3 +2,5 @@ from .client import *
 from .network import *
 from .server import *
 from .utils import *
+
+__version__ = '0.7.1'