level12 / pyp

Python release tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Respect __version__ when writing version file

nZac opened this issue · comments

pyp is only for packaging, it doesn't care what the app itself does with the version. If you want to make your app have a mymod.__version__ attribute that represents the version, you are welcome to do that. Example from keg-auth:

https://github.com/level12/keg-auth/blob/bbe5cc3ca2b3dc4a5a120290336369baf0baf74e/keg_auth/__init__.py#L32

from keg_auth.version import VERSION as __VERSION__

It's intentional that pyp only looks at the version.py file. From the pyp readme:

Make sure you are single-sourcing the version of the project using the same method as this project. See our setup.py and pyp/version.py.

This standard enables pyp to read ONLY the version.py which avoids any possible side effects from having to import the root application to get at it's __version__ attribute.

So, to be clear, you MUST use a version.py to use pyp. It's deliberate that pyp does not try and use mymod.__version__ to single-source the version string.

Unless I misunderstand the situation or our current methodology has adverse affects I'm not considering, this issue should be closed as a WON'T FIX.

won't fix