[Python-Dev] PEP 376 : Changing the .egg-info structure

MRAB google at mrabarnett.plus.com
Tue May 19 16:21:25 CEST 2009


Tarek Ziadé wrote:
> On Sat, May 16, 2009 at 6:55 PM, P.J. Eby <pje at telecommunity.com> wrote:
>> 1. Why ';' separation, instead of tabs as in PEP 262?  Aren't semicolons a
>> valid character in filenames?
> 
> I am changing this into a <tab>. for now.
> 
> What about Antoine's idea about doing a quote() on the names ?
> 
>>From my point of view <tabs> seems more simple to deal with, if 3rd-party
> tools want to work on these files without using pkgutil or Python.
> 
>> 4. There should probably be a way to iterate over the projects in a
>> directory, since it's otherwise impossible for an installation tool to find
>> out what project(s) "own" a file that conflicts with something being
>> installed.  Alternatively, reshaping the file API to allow querying by path
>> as well as by project might work.
> 
> I am adding a "get_projects" api:
> 
>   get_projects() -> iterator
> 
>   Provides an iterator that will return (name, path) tuples, where `name`
>   is the name of a registered project and `path` the path to its `egg-info`
>   directory.
> 
> But for the use case you are mentioning, what about an explicit API:
> 
>   get_owners(paths) -> sequence of project names
> 
>   returns a sequence of tuple. For each path in the "paths" list, a
> tuple of project names
>   is returned
> 
>> 5. If any cache mechanisms are to be used by the API, the API *must* make it
>> possible to bypass or explicitly manage that cache, as otherwise
>> installation tools and tools that manipulate sys.path at runtime may end up
>> using incorrect data.
> 
> work in progress - (I am afraid I have to write an advanced prototype
> to be able to know
> exaclty how the cache might work, and so, what API we should have)
> 
>> 6. get_files() doesn't document whether the yielded paths are absolute or
>> relative, local or cross-platform, etc.
> 
> I am fixing this as well
> 
> 
>>> I need to find back your comments for this part, I must have missed
>>> them. That's
>>> the last part I didn't work out yet on the current PEP revision.
>> Well, if you can't find them, the EggFormats doc explains how these file/dir
>> structures are currently laid out by setuptools, easy_install, pip, etc.,
>> and the PEP should probably reference that.
> 
> work in progress
> 
Is it Pythonic for the methods to starts with "get_", or should they be
projects(), owners(), etc?


More information about the Python-Dev mailing list