Fixed bug in version naming.

With git flow, the version is read by the tag
(base_version) in setuptools_scm.
This commit is contained in:
Sylvain Tricot 2022-03-07 15:38:35 +01:00
parent 4890a9e1f9
commit 0f2a556aa2
1 changed files with 5 additions and 4 deletions

View File

@ -35,10 +35,11 @@ try:
from setuptools_scm import get_version
v = get_version(root='../../../', relative_to=__file__, version_scheme="post-release")
v = parse_version(v)
if v._version.post[-1] == 0:
__version__ = v.base_version
else:
__version__ = v.public
__version__ = v.base_version
# if v._version.post[-1] == 0:
# __version__ = v.base_version
# else:
# __version__ = v.public
except Exception as err:
try:
__version__ = get_distribution(__name__.strip('.version')).version