Skip to content

Commit

Permalink
Merge pull request #521 from joergsteffens/master
Browse files Browse the repository at this point in the history
python-bareos: fix for adapting version number to PEP-440
  • Loading branch information
joergsteffens committed May 15, 2020
2 parents 2e5fec6 + 02f8a65 commit 8bda99f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python-bareos/setup.py
@@ -1,6 +1,7 @@
#!/usr/bin/python

import os
import re
from setuptools import find_packages, setup


Expand All @@ -12,8 +13,10 @@ def get_version():
os.path.join(base_dir, "bareos", "VERSION.txt")
) as version_file:
# read version
# and adapt it according to https://www.python.org/dev/peps/pep-0440/.
__version__ = version_file.read().strip().replace('~pre','.dev')
# and adapt it according to
# https://www.python.org/dev/peps/pep-0440/.
fullversion = version_file.read().strip()
__version__ = re.compile(r'~pre([0-9]+).*').sub(r'.dev\1', fullversion)
except IOError:
# Fallback version.
# First protocol implemented
Expand Down

0 comments on commit 8bda99f

Please sign in to comment.