Req: easy_install.py --site-dirs

I tried doing a bit of EasyInstall evangelism, and apparently, the Kool-Aid isn't quite sweet enough yet. ;-) I got feedback from someone trying the very first example with SQLObject in the documentation. He is using Debian Linux and thus does not install anything that's not from a .deb into /usr/lib. User-installed Python packages need to go into /usr/local/lib/python2.x/site-packages. To encourage this, Debian's site.py is patched to add that to the list of .pth-enabled directories. I imagine that similarly conscientious/anal distributions do likewise. My friend is a bit more conservative than that, even. He manages /usr/local using GNU Stow so he can make installations as non-root. This is very important to him. He's even willing to use tricky .pth hacks[1] to permit this. Fortunately, all of his technical concerns can be addressed by adding --site-dirs. [1] As documented here: http://article.gmane.org/gmane.comp.python.distutils.devel/1895 -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

Hello, I'm new to this list so I will introduce myself... I'm an italian Ph.D. student working on http://udu.wiki.ubuntu.com/PythonModulePackaging http://udu.wiki.ubuntu.com/PackagesFromPyPi as google's SummerOfCode project. Basically ubuntu (a debian derivative distro) wants: 1. a tool to create packages of python modules "automatically" from PyPI (like EasyInstall does with eggs) 2. a setup where on python upgrade all compatible python modules are migrated to the new installation. I'm quite new to distutils so I'd like comments / critics / suggestions... I hope ubuntu will adopt my work for breezy: I will actually code what we all decide is the best solution (they pay me for this work). Regards Vincenzo Alle 21:34, sabato 16 luglio 2005, Robert Kern ha scritto:
I tried doing a bit of EasyInstall evangelism, and apparently, the Kool-Aid isn't quite sweet enough yet. ;-)
I got feedback from someone trying the very first example with SQLObject in the documentation. He is using Debian Linux and thus does not install anything that's not from a .deb into /usr/lib. User-installed Python packages need to go into /usr/local/lib/python2.x/site-packages. To encourage this, Debian's site.py is patched to add that to the list of .pth-enabled directories. I imagine that similarly conscientious/anal distributions do likewise.
My friend is a bit more conservative than that, even. He manages /usr/local using GNU Stow so he can make installations as non-root. This is very important to him. He's even willing to use tricky .pth hacks[1] to permit this.
Fortunately, all of his technical concerns can be addressed by adding --site-dirs.
[1] As documented here: http://article.gmane.org/gmane.comp.python.distutils.devel/1895

Okay, I've checked in a preliminary version of --site-dirs support in the Python CVS HEAD of nondist/sandbox/setuptools; why don't you give that a try? It may be a few hours before it's available for anonymous checkout, however, as Sourceforge only updates their anoncvs snapshots every six hours or so, IIRC. If you have Python developer privileges, you can get it sooner than that. At 12:34 PM 7/16/2005 -0700, Robert Kern wrote:
I tried doing a bit of EasyInstall evangelism, and apparently, the Kool-Aid isn't quite sweet enough yet. ;-)
I got feedback from someone trying the very first example with SQLObject in the documentation. He is using Debian Linux and thus does not install anything that's not from a .deb into /usr/lib. User-installed Python packages need to go into /usr/local/lib/python2.x/site-packages. To encourage this, Debian's site.py is patched to add that to the list of .pth-enabled directories. I imagine that similarly conscientious/anal distributions do likewise.
My friend is a bit more conservative than that, even. He manages /usr/local using GNU Stow so he can make installations as non-root. This is very important to him. He's even willing to use tricky .pth hacks[1] to permit this.
Fortunately, all of his technical concerns can be addressed by adding --site-dirs.
[1] As documented here: http://article.gmane.org/gmane.comp.python.distutils.devel/1895
-- Robert Kern rkern@ucsd.edu
"In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig

Phillip J. Eby wrote:
Okay, I've checked in a preliminary version of --site-dirs support in the Python CVS HEAD of nondist/sandbox/setuptools; why don't you give that a try? It may be a few hours before it's available for anonymous checkout, however, as Sourceforge only updates their anoncvs snapshots every six hours or so, IIRC. If you have Python developer privileges, you can get it sooner than that.
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like addsitedir('/Users/kern/lib/python2.4') Although it will be just happy with import site; site.addsitedir('/Users/kern/lib/python2.4') Thank you very much! -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Phillip J. Eby wrote:
Okay, I've checked in a preliminary version of --site-dirs support in the Python CVS HEAD of nondist/sandbox/setuptools; why don't you give that a try? It may be a few hours before it's available for anonymous checkout, however, as Sourceforge only updates their anoncvs snapshots every six hours or so, IIRC. If you have Python developer privileges, you can get it sooner than that.
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was: import os; addsitedir(os.path.expanduser('~/lib/python2.3')) So I'm not sure what you mean here.

Phillip J. Eby wrote:
At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was:
import os; addsitedir(os.path.expanduser('~/lib/python2.3'))
So I'm not sure what you mean here.
Eventually someone is going to want to do addsitedir('/usr/local/stow/easy_install/lib/python2.4/site-packages') which won't work. The explicit "import site" encourages people not to tread that path. -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

At 09:22 PM 7/16/2005 -0700, Robert Kern wrote:
Phillip J. Eby wrote:
At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was:
import os; addsitedir(os.path.expanduser('~/lib/python2.3'))
So I'm not sure what you mean here.
Eventually someone is going to want to do
addsitedir('/usr/local/stow/easy_install/lib/python2.4/site-packages')
But I didn't give that (or anything like it) as an example in the documentation, so I still don't understand what it is you're asking me to do.

Phillip J. Eby wrote:
At 09:22 PM 7/16/2005 -0700, Robert Kern wrote:
Phillip J. Eby wrote:
At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was:
import os; addsitedir(os.path.expanduser('~/lib/python2.3'))
So I'm not sure what you mean here.
Eventually someone is going to want to do
addsitedir('/usr/local/stow/easy_install/lib/python2.4/site-packages')
But I didn't give that (or anything like it) as an example in the documentation, so I still don't understand what it is you're asking me to do.
When I went to modify the example to suit my needs, I thought, "Okay, I don't really need to use os.path.expanduser(), so I'll just remove the 'import os'." That didn't work. If instead the example had an explicit "import site; site.addsitedir(...)", I would never have tried the plain "addsitedir(...)" which doesn't work. An explicit statement that the bare "addsitedir(...)" doesn't work would be fine, too. -- Robert Kern rkern@ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

On Jul 16, 2005, at 6:45 PM, Robert Kern wrote:
Phillip J. Eby wrote:
At 09:22 PM 7/16/2005 -0700, Robert Kern wrote:
Phillip J. Eby wrote:
At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was:
import os; addsitedir(os.path.expanduser('~/lib/ python2.3'))
So I'm not sure what you mean here.
Eventually someone is going to want to do
addsitedir('/usr/local/stow/easy_install/lib/python2.4/site- packages')
But I didn't give that (or anything like it) as an example in the documentation, so I still don't understand what it is you're asking me to do.
When I went to modify the example to suit my needs, I thought, "Okay, I don't really need to use os.path.expanduser(), so I'll just remove the 'import os'." That didn't work. If instead the example had an explicit "import site; site.addsitedir(...)", I would never have tried the plain "addsitedir(...)" which doesn't work.
An explicit statement that the bare "addsitedir(...)" doesn't work would be fine, too.
pth files eval lines that start with the word "import". If there's no import there, it will add it to sys.path. The fact that addsitedir works bare is uh.. coincidence, because it happens to be eval'ed in the scope of the site module. I wouldn't write it like that. -bob

On Jul 16, 2005, at 6:17 PM, Phillip J. Eby wrote:
At 09:01 PM 7/16/2005 -0700, Robert Kern wrote:
Phillip J. Eby wrote:
Okay, I've checked in a preliminary version of --site-dirs support in the Python CVS HEAD of nondist/sandbox/setuptools; why don't you give that a try? It may be a few hours before it's available for anonymous checkout, however, as Sourceforge only updates their anoncvs snapshots every six hours or so, IIRC. If you have Python developer privileges, you can
get it
sooner than that.
Ah, now that's service! It works fine for me. I would suggest changing the altinstall.pth example, though. Python doesn't seem to like
addsitedir('/Users/kern/lib/python2.4')
Although it will be just happy with
import site; site.addsitedir('/Users/kern/lib/python2.4')
Um, the example I put in the EasyInstall doc for --site-dirs was:
import os; addsitedir(os.path.expanduser('~/lib/python2.3'))
So I'm not sure what you mean here.
addsitedir is not a built-in, that's what he means. -bob
participants (4)
-
Bob Ippolito
-
Phillip J. Eby
-
Robert Kern
-
Vincenzo Di Massa