[Python-Dev] PEP 376 : Changing the .egg-info structure (original) (raw)

Tarek Ziadé ziade.tarek at gmail.com
Tue May 19 16:04:21 CEST 2009


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 . for now.

What about Antoine's idea about doing a quote() on the names ?

From my point of view 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. getfiles() 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, easyinstall, pip, etc., and the PEP should probably reference that.

work in progress

Tarek

Tarek Ziadé | http://ziade.org



More information about the Python-Dev mailing list