From cb6ec31e3305aa70c6daaf5c47c46fda5f59e76d Mon Sep 17 00:00:00 2001 From: Floris Lambrechts Date: Sun, 16 Dec 2018 21:39:00 +0100 Subject: [PATCH] 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. --- mypackage/__init__.py | 2 +- mypackage/{__version__.py => _version.py} | 0 setup.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename mypackage/{__version__.py => _version.py} (100%) diff --git a/mypackage/__init__.py b/mypackage/__init__.py index e7ebf36..a21f065 100644 --- a/mypackage/__init__.py +++ b/mypackage/__init__.py @@ -1,5 +1,5 @@ -from .__version__ import VERSION +from ._version import VERSION __version__ = '.'.join(map(str, VERSION)) from .core import * diff --git a/mypackage/__version__.py b/mypackage/_version.py similarity index 100% rename from mypackage/__version__.py rename to mypackage/_version.py diff --git a/setup.py b/setup.py index 702b973..4b2ffb8 100644 --- a/setup.py +++ b/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: