[Python-ideas] Add a site.cfg to keep a persistent list of paths
ianb at colorstudy.com
Thu Oct 21 16:44:50 CEST 2010
On Wed, Oct 20, 2010 at 6:35 PM, Floris Bruynooghe <flub at devork.be> wrote:
> On 20 October 2010 15:27, Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> > On Wed, Oct 20, 2010 at 4:00 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> >> 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...
> I've read your and Ian's responses and still don't understand what
> setup.py develop brings to the party which can't be done with simple
> PYTHONPATH. Excuse me if I also completely misunderstand what develop
> does but it sounds like it's going to add an in-development version of
> a project on a users's sys.path (at the front?) until it's undone
> again somehow (is there a "setup.py undevelop"?).
pip uninstall would unlink it (pip install -e calls setup.py develop as
well). setup.py develop is persistent unlike PYTHONPATH.
> This just seems
> dangerous to me since it will affect all python programs run by that
Hence virtualenv, which solves your other concerns.
> If I understand correctly this whole "develop" dance is for when you
> have two inter-depended packages in development at the same time. If
> manually setting PYTHONPATH correctly in this situation is too
> complicated then my feeling is there's nothing wrong with some sort of
> helper which manipulates PYTHONPATH for you, something like spaw a new
> shell and set the environment in that correctly. But placing things
> in files makes this permanent for the user and just seems the wrong
> way to go to me.
> Again, apologies if I understand the problem wrongly. But I too am
> worried about too many complexities and "magic". One of my main
> issues with setuptools is that it tries to handle my python
> environment (sys.path) outside of normally expected python mechanisms
> by modifying various custom files. I would hate to see distutils2
> repeat this.
Note if you use pip, it uses setuptools in a way where only setup.py develop
uses .pth files, and otherwise the path is similar to how it is with
distutils alone (except with that extra metadata, as Doug mentions).
Ian Bicking | http://blog.ianbicking.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas