[Distutils] Splitting distribute in several distributions

Tarek Ziadé ziade.tarek at gmail.com
Thu Aug 13 00:13:59 CEST 2009


On Thu, Aug 13, 2009 at 12:01 AM, Barry Warsaw<barry at python.org> wrote:
> 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
>

If we make the assumption the module is called only when it's
installed in Python, not at all.
But then, the real version number has to be somewhere, eg setup.py,
which is less nice that having it in __version__ ... :)

I think things will look better the day we remove setup.py in favor of
a static metadata file.


-- 
Tarek Ziadé | http://ziade.org


More information about the Distutils-SIG mailing list