Merge pull request #57 from florisla/version-module-attribute

Follow PEP 396: expose __version__ string as a module-level attribute
This commit is contained in:
Kenneth Reitz 2019-02-13 08:32:33 -05:00 committed by GitHub
commit 51938e5089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -1 +1,5 @@
from ._version import VERSION
__version__ = '.'.join(map(str, VERSION))
from .core import *

View File

@ -4,5 +4,3 @@
# 88 YY 88 dP 88 dP""""Yb YboodP 88 Yb dP""""Yb YboodP 888888
VERSION = (5, 2, 0)
__version__ = '.'.join(map(str, VERSION))

View File

@ -45,11 +45,12 @@ try:
except FileNotFoundError:
long_description = DESCRIPTION
# Load the package's __version__.py module as a dictionary.
# Load the package's _version.py module as a dictionary.
about = {}
if not VERSION:
with open(os.path.join(here, NAME, '__version__.py')) as f:
with open(os.path.join(here, NAME, '_version.py')) as f:
exec(f.read(), about)
about['__version__'] = '.'.join(map(str, about['VERSION']))
else:
about['__version__'] = VERSION