Rename __version__.py to _version.py

This avoids a name collision with mypackage.__version__
(the string).

In addition, the single underscore shows it's a 'private' module
that has no special meaning to the Python interpreter.
This commit is contained in:
Floris Lambrechts 2018-12-16 21:39:00 +01:00
parent aa60dc88c2
commit cb6ec31e33
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -45,10 +45,10 @@ try:
except FileNotFoundError: except FileNotFoundError:
long_description = DESCRIPTION long_description = DESCRIPTION
# Load the package's __version__.py module as a dictionary. # Load the package's _version.py module as a dictionary.
about = {} about = {}
if not VERSION: 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) exec(f.read(), about)
about['__version__'] = '.'.join(map(str, about['VERSION'])) about['__version__'] = '.'.join(map(str, about['VERSION']))
else: else: