[Distutils] distribute 0.6.10 and convert_2to3_doctests

Barry Warsaw barry at python.org
Sun Jan 31 01:03:58 CET 2010


On Jan 29, 2010, at 06:53 PM, P.J. Eby wrote:

>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.

That's good to know.  What about adding an API to make that even simpler:

pkg_resources.get_version('MyProject')

?

-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20100130/52309d42/attachment.pgp>


More information about the Distutils-SIG mailing list