On Aug 12, 2009, at 5:58 PM, Tarek Ziadé wrote:

yes, and with PEP 376 (which I need to work back in asap), it will be
similar and we will
have that explicit, clean, get_metadata api.

Notice that I think it's better to use pkg_resources (and PEP 376)
tehcnique because it grabs the version
number in the PKG-INFO file which is static, and doesn't forces you to
import a module
in the execution context just to get the version. You never know what
gets executed when you import a module

Right, but sometimes all you know is the execution context.

Do you see any reason why a library author couldn't write this in their __init__.py?

import pkg_resources
__version__ = pkg_resources.get_distribution('foo.bar').version

?
-Barry

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to