[Distutils] PEP 376 up-to-date
pje at telecommunity.com
Tue May 26 05:59:52 CEST 2009
At 12:29 PM 5/25/2009 +0200, Tarek Ziadé wrote:
>I have updated PEP 376, mainly with Phillip's feedback, and changed
>the API section so it looks like the current prototype.
>- PEP : http://svn.python.org/view/peps/trunk/pep-0376.txt?view=markup
>- prototype code : http://bitbucket.org/tarek/pep376/src/tip/pkgutil.py
>I'll wait for a new round of feedbacks, Thanks !
* There's no reason for anything shown in the module to be private;
is_egg_info() and egg_info_dirs() would be useful API functions, and
the additions to DistributionMetadata might as well go in distutils
* Better yet, move DistributionMetadata to pkgutil and have
distutils.dist import it; that way you won't get tons of distutils.*
imports any time you import pkgutil.
* get_egg_infos() should take a pathlist argument, which if None can
default to sys.path.
* Project name normalization and case insensitive comparison is still
* File path normalization (absolutizing, case-normalization,
de-cross-platforming, etc.) is not implemented
* There is extensive coupling both to sys.path and to the global
cache; in particular, the owns() operation properly belongs to an
object representing a *directory*, rather than an object representing
an individual project.
Note too that such "directory" objects would then also be an
appropriate cache target, and a suitable home for egg_info_dirs() and
get_file_users() operations. This also simplifies get_egg_infos,
since it would simply either retrieves directories from the cache or
creates them and optionally caches them, without also meddling in the
details of cache contents.
Also, an application that wishes to do so can simply create directory
objects of its own and manage their lifecycle accordingly.
Personally, I would also make an object for a collection of
directories, but you could possibly get away without it.
(At this point, I have only briefly skimmed the updated PEP; I'll
take a closer look at it once the API/implementation gets more settled.)
More information about the Distutils-SIG