mirror of
https://github.com/kennethreitz/setup.py.git
synced 2026-06-05 23:10:17 +00:00
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:
@@ -1,5 +1,5 @@
|
||||
|
||||
from .__version__ import VERSION
|
||||
from ._version import VERSION
|
||||
__version__ = '.'.join(map(str, VERSION))
|
||||
|
||||
from .core import *
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user