Compare commits

...

6 Commits

Author SHA1 Message Date
Timo Furrer
1ff577e9a5
Merge pull request #65 from kennethreitz/add-packaging-guide
Add a link to the official Python Packaging Guide. Closes #40
2019-02-14 20:09:57 +01:00
Timo Furrer
7cca62f7e9
Add a link to the official Python Packaging Guide. Closes #40 2019-02-14 18:27:13 +01:00
Kenneth Reitz
3e54227206
Merge pull request #62 from devxpy/patch-2
Use a valid python package name instead of just NAME to find the __version__.py file
2019-02-13 08:39:01 -05:00
Kenneth Reitz
a0e82fa640
Merge pull request #64 from kennethreitz/revert-57-version-module-attribute
Revert "Follow PEP 396: expose __version__ string as a module-level attribute"
2019-02-13 08:33:10 -05:00
Dev Aggarwal
c98aca0c67
Update setup.py 2018-12-15 19:08:16 +05:30
Dev Aggarwal
38212d4b91
Update setup.py 2018-12-13 21:00:57 +05:30
2 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@ More Resources
--------------
- [What is setup.py?] on Stack Overflow
- [Official Python Packaging User Guide](https://packaging.python.org)
- [The Hitchhiker's Guide to Packaging]
- [Cookiecutter template for a Python package]

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