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
signature.asc
Description: PGP signature
_______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
