[Distutils] question about setuptools
Phillip J. Eby
pje at telecommunity.com
Wed Sep 14 08:07:19 CEST 2005
At 09:42 PM 9/13/2005 -0700, Robert Kern wrote:
>Phillip J. Eby wrote:
> > At 06:43 PM 9/13/2005 -0700, Robert Kern wrote:
> >>My request is that if --prefix is provided, then the value of
> >>--site-dirs be calculated from it.
> > I'd suggest using PYTHONHOME instead, since that will actually make Python
> > run from that directory.
>That's not what these users need, however. Python is installed to /usr
>and the standard library and all of the third-party packages that are
>part of Debian's packaging system go under /usr/lib/python2.x/ .
>Third-party packages that are compiled by the user go under
>/usr/local/lib/python2.x/site-packages/ . The way everybody accomplishes
>this is by setting --prefix=/usr/local for distutils.
Well, as long as it ends up on sys.path *and* processes .pth files, it
should be fine. Question: are these /usr/local/* versions on sys.path
*before* the /usr versions? Or after?
> > However, my main concern is not making these path
> > calculations any more screwy than they already have to be, as they are
> > already quite complex. So, if you can suggest a patch to implement your
> > desired behavior that doesn't break anything else and doesn't make my head
> > explode upon reviewing it, I'll be happy to check it in. :)
>The path part isn't hard. If --prefix or --home is provided, the install
>command will calculate the path for you and place it in
>install.install_lib . The hard part seems to be figuring out whether the
>user explicitly provided --prefix or --install-lib or neither.
I'll take your word for it. :) Again, I'll be happy to look at a patch,
but I don't have the bandwidth to figure out this particular setup.
One possible hack: assume that any directory on sys.path whose basename is
"site-packages" is a valid --site-dir. The worst that can do is fail. :)
More information about the Distutils-SIG