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:
parent
aa60dc88c2
commit
cb6ec31e33
@ -1,5 +1,5 @@
|
||||
|
||||
from .__version__ import VERSION
|
||||
from ._version import VERSION
|
||||
__version__ = '.'.join(map(str, VERSION))
|
||||
|
||||
from .core import *
|
||||
|
||||
4
setup.py
4
setup.py
@ -45,10 +45,10 @@ 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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user