Setuptools with custom path configuration
I revisited setuptools again tonight hoping to learn a bit more about it. Unfortunately I'm still stuck where I was last time I looked. I'm using Combinator to manage my Python libraries. This means that I have a fair amount of software installed at ~/.local/lib/pythonX.Y/site-packages, a PYTHONPATH which includes only ~/Projects/Divmod/trunk/Combinator, at which location resides a sitecustomize.py which sets up the rest of my path.
From the documentation, and various experimentation, it seems like this configuration is still not supported. What needs to happen for to change this?
Jean-Paul
At 09:19 PM 10/16/2006 -0400, Jean-Paul Calderone wrote:
I revisited setuptools again tonight hoping to learn a bit more about it. Unfortunately I'm still stuck where I was last time I looked.
I'm using Combinator to manage my Python libraries. This means that I have a fair amount of software installed at ~/.local/lib/pythonX.Y/site-packages, a PYTHONPATH which includes only ~/Projects/Divmod/trunk/Combinator, at which location resides a sitecustomize.py which sets up the rest of my path.
From the documentation, and various experimentation, it seems like this configuration is still not supported.
It is supported. What problem are you having? As long as you are having setuptools install packages to a directory on PYTHONPATH, you should be fine. If you are installing to a directory that is not on PYTHONPATH, then it has to be a "site" directory, meaning that you add it to sys.path using site.addsitedir(). If you don't do this, then .pth files in the directory will not be processed, and setuptools will not allow installing packages there except in --multi-version mode (which needs an explicit require() operation to add the package to sys.path at runtime, rather than always including it on sys.path at startup).
On Mon, 16 Oct 2006 23:11:05 -0400, "Phillip J. Eby"
At 09:19 PM 10/16/2006 -0400, Jean-Paul Calderone wrote:
I revisited setuptools again tonight hoping to learn a bit more about it. Unfortunately I'm still stuck where I was last time I looked.
I'm using Combinator to manage my Python libraries. This means that I have a fair amount of software installed at ~/.local/lib/pythonX.Y/site- packages, a PYTHONPATH which includes only ~/Projects/Divmod/trunk/Combinator, at which location resides a sitecustomize.py which sets up the rest of my path.
From the documentation, and various experimentation, it seems like this configuration is still not supported.
It is supported. What problem are you having? As long as you are having setuptools install packages to a directory on PYTHONPATH, you should be fine.
When I run ez_setup.py, it tells me: TEST FAILED: /home/exarkun/.local/lib/python2.4/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH ... /home/exarkun/.local/lib/python2.4/site-packages/ is not in PYTHONPATH, but it has been passed to site.addsitedir(). Jean-Paul
At 08:09 AM 10/17/2006 -0400, Jean-Paul Calderone wrote:
When I run ez_setup.py, it tells me:
TEST FAILED: /home/exarkun/.local/lib/python2.4/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH
...
/home/exarkun/.local/lib/python2.4/site-packages/ is not in PYTHONPATH, but it has been passed to site.addsitedir().
But the file that does it is in PYTHONPATH... which means it's not getting run during the test, which uses python -E. Argh. I've never seen a configuration that used (and needed) PYTHONPATH *and* sitecustomize *and* a site directory before. You're right, this configuration isn't really supported well. easy_install expects non-PYTHONPATH site dirs to be supported by Python itself, not by a PYTHONPATH dir causing the other one to be loaded. I'll have to see about a fix.
On Tue, 17 Oct 2006 11:32:13 -0400, "Phillip J. Eby"
[snip]
You're right, this configuration isn't really supported well. easy_install expects non-PYTHONPATH site dirs to be supported by Python itself, not by a PYTHONPATH dir causing the other one to be loaded. I'll have to see about a fix.
Okay, thanks. Let me know if there's anything I can do to help; testing, etc. Jean-Paul
At 11:43 AM 10/17/2006 -0400, Jean-Paul Calderone wrote:
On Tue, 17 Oct 2006 11:32:13 -0400, "Phillip J. Eby"
wrote: [snip]
You're right, this configuration isn't really supported well. easy_install expects non-PYTHONPATH site dirs to be supported by Python itself, not by a PYTHONPATH dir causing the other one to be loaded. I'll have to see about a fix.
Okay, thanks. Let me know if there's anything I can do to help; testing, etc.
I'm about to be away from 'net access for a week; will let you know when I get back.
On Tue, 17 Oct 2006 11:43:07 -0400, Jean-Paul Calderone
On Tue, 17 Oct 2006 11:32:13 -0400, "Phillip J. Eby"
wrote: [snip]
You're right, this configuration isn't really supported well. easy_install expects non-PYTHONPATH site dirs to be supported by Python itself, not by a PYTHONPATH dir causing the other one to be loaded. I'll have to see about a fix.
Okay, thanks. Let me know if there's anything I can do to help; testing, etc.
Had a chance to do anything with this yet?
Jean-Paul
At 10:18 PM 10/30/2006 -0500, Jean-Paul Calderone wrote:
On Tue, 17 Oct 2006 11:43:07 -0400, Jean-Paul Calderone
wrote: On Tue, 17 Oct 2006 11:32:13 -0400, "Phillip J. Eby"
wrote: [snip]
You're right, this configuration isn't really supported well. easy_install expects non-PYTHONPATH site dirs to be supported by Python itself, not by a PYTHONPATH dir causing the other one to be loaded. I'll have to see about a fix.
Okay, thanks. Let me know if there's anything I can do to help; testing, etc.
Had a chance to do anything with this yet?
No. It's probably as simple as removing the -E from the test code, but I need to check my assumptions and make sure there isn't some other reason -E is needed. It's on my list for when I get back to work on setuptools stuff, hopefully later this week. A bunch of people at OSAF are currently blocked on other work I'm doing for them, so setuptools ATM is lower on my priority list, as is pretty much any other programming work. Of course, if somebody else wants to hazard an investigation into what, if anything, might be broken by removing the -E, ... oh crap. There's probably a heck of a lot simpler way to fix this: use the --site-dirs option to easy_install, or set it in a distutils configuration file. Duh. I should've thought of suggesting that before. Here's the bit from the docs: ``--site-dirs=DIRLIST, -S DIRLIST`` (New in 0.6a1) Specify one or more custom "site" directories (separated by commas). "Site" directories are directories where ``.pth`` files are processed, such as the main Python ``site-packages`` directory. As of 0.6a10, EasyInstall automatically detects whether a given directory processes ``.pth`` files (or can be made to do so), so you should not normally need to use this option. It is now only necessary if you want to override EasyInstall's judgment and force an installation directory to be treated as if it supported ``.pth`` files. I should probably still look into removing the -E, but this is probably a sufficient immediate workaround for your current situation. Sorry I didn't think of it before.
participants (2)
-
Jean-Paul Calderone
-
Phillip J. Eby