Merge pull request #62 from devxpy/patch-2

Use a valid python package name instead of just NAME to find the __version__.py file
This commit is contained in:
Kenneth Reitz 2019-02-13 08:39:01 -05:00 committed by GitHub
commit 3e54227206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,8 @@ except FileNotFoundError:
# 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:
project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
with open(os.path.join(here, project_slug, '__version__.py')) as f:
exec(f.read(), about)
else:
about['__version__'] = VERSION