[Distutils] distribute 0.6.10 and convert_2to3_doctests

P.J. Eby pje at telecommunity.com
Sat Jan 30 00:53:08 CET 2010


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.



More information about the Distutils-SIG mailing list