[Distutils] PEP 376 for Distutils

Floris Bruynooghe floris.bruynooghe at gmail.com
Tue Feb 24 00:13:10 CET 2009


Hello Tarek

On Sun, Feb 22, 2009 at 03:37:50AM +0100, Tarek Ziadé wrote:
> I have started a PEP for Distutils, I would like to work out for Pycon.
> 
> http://svn.python.org/projects/peps/trunk/pep-0376.txt

Looks quite nice so far IMHO.  Here some early feedback...


"""
Back to our `zlib` example, we will have::

    - zlib
    - zlib-2.5.2-py2.6.egg-info/
        PKG-INFO
        MANIFEST
        RECORD
"""

What is the rationale for the `-2.5.2-py2.6' part in the name of the
.egg-info directory?  I'm not saying I'm against it, rather that I'd
like to see a rationale for why it is there and why it is different
from the current distutils bit (doesn't add the python version, only
package version).

Related to this how is the behaviour of pkgutil.get_egg_info() defined
in respect to this?  It mentions that all `pkg_name*.egg-info' files
are looked for and None is returned if none is found.  But no word on
what happens if more then one is found.  (Should that be an error?
Guess it depends on the anser to the previous paragraph.)


"""
Let's use it over our `zlib` example::

    >>> from pkgutil import get_egg_info, get_metadata,
        get_egg_info_file
    >>> get_egg_info('zlib')
    '/opt/local/lib/python2.6/site-packages/zlib-2.5.2-py2.6.egg-info'
    >>> metadata = get_metadata('zlib')
    >>> metadata.version
    '2.5.2'
    >>> from distutils.dist import EGG_INFO_FILES
    >>> get_metadata('zlib', EGG_INFO_FILES.manifest).read()
    some
    ...
    files
"""

I think there's a typo in the last call here.  Should that not be
`get_egg_info_file('zlib', EGG_INFO_FILES.manifest).read()'?


Finally about the install and uninstall script.  Is this going to
attempt to address the namespace packages problem or will this be left
for a later PEP?  AIUI if it doesn't (which seems reasonable,
distutils never could do this) but setuptools does install such a
package then distutils will happily try to remove it, using the
.egg-info/RECORD file.  But this might then mess up any uninstall
attempt from setuptools since a shared __init__.py might have been
removed.


Hope this was helpful in some way.

Regards
Floris

-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org


More information about the Distutils-SIG mailing list