Skip to content

Commit cb6ec31

Browse files
author
Floris Lambrechts
committed
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.
1 parent aa60dc8 commit cb6ec31

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

mypackage/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from .__version__ import VERSION
2+
from ._version import VERSION
33
__version__ = '.'.join(map(str, VERSION))
44

55
from .core import *
File renamed without changes.

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
except FileNotFoundError:
4646
long_description = DESCRIPTION
4747

48-
# Load the package's __version__.py module as a dictionary.
48+
# Load the package's _version.py module as a dictionary.
4949
about = {}
5050
if not VERSION:
51-
with open(os.path.join(here, NAME, '__version__.py')) as f:
51+
with open(os.path.join(here, NAME, '_version.py')) as f:
5252
exec(f.read(), about)
5353
about['__version__'] = '.'.join(map(str, about['VERSION']))
5454
else:

0 commit comments

Comments
 (0)