[Python-ideas] Add a site.cfg to keep a persistent list of paths (original) (raw)

Tarek Ziadé ziade.tarek at gmail.com
Wed Oct 20 16:27:21 CEST 2010


On Wed, Oct 20, 2010 at 4:00 PM, Paul Moore <p.f.moore at gmail.com> wrote: ...

If you're saying that Foo isn't a package itself, so Foo/init.py doesn't exist, and bar and baz should be visible unqualified, then I begin to see your issue (although my first reaction is to say "don't do that, then" :-)). But don't you then just need to search parents of elements of PYTHONPATH as well for the metadata search? If that's an issue then doesn't that mean you've got other problems with how people structure their directories? Actually, I suspect my picture above is wrong, as I can't honestly see that mandating that the dist-info file be a sibling (in an arbitrarily cluttered directory) of the project directory, is sensible...

yeah that the main issue: we can't make assumptions on how the source tree looks in the project, so adding the root path will not work all the time. Some people even have two separate root packages. Which is not a good layout, but allowed.. In Zope, I think the convention is to use a src/ directory so that's another level.

Since distutils1 and distutils2 will let you provide in their options a list of packages and modules, I think it's the only sane way to get a list of paths we can then add in the path.

But I'm probably not seeing the real issues here. All I would say is, don't let the needs of more unusual configurations over-complicate basic usage.

The trouble is: adding in PYTHONPATH the root of the source of your project can be different from what it would be once installed in Python. Now the question is: if 90% of the projects out there would work by adding the root, then this is might be overkill. I am afraid it's way less though...

Tarek

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



More information about the Python-ideas mailing list