At 04:05 PM 1/29/2010 -0500, Barry Warsaw wrote:
The important thing is to have exactly one place to set
the package's version number.

Put it in setup.py, then. If you absolutely must have a __version__ at runtime, use this to extract it from the installation metadata:

    __version__ = pkg_resources.require('MyProject')[0].version

Mostly, though, I don't bother with having a __version__ in my modules or packages any more, since you can just do the above if you want to check the installed version of something.

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to