[Python-Dev] Proposing PEP 376

P.J. Eby pje at telecommunity.com
Wed Apr 7 19:45:20 CEST 2010


At 04:40 PM 4/7/2010 +0200, Tarek Ziadé wrote:
>On Wed, Apr 7, 2010 at 4:35 PM, P.J. Eby <pje at telecommunity.com> wrote:
> > At 04:01 PM 4/7/2010 +0200, Tarek Ziadé wrote:
> >>
> >> 2010/4/2 P.J. Eby <pje at telecommunity.com>:
> >> [...]
> >> >
> >> > * Paths under the base installation location are relative to the base
> >> > * Paths not under the base installation location, but under the
> >> > installation
> >> > prefix, are also stored relative to the base, IF the base location is a
> >> > subpath of the installation prefix
> >> > * All other paths are absolute.
> >> >
> >> > Where "base location" is the effective --install-lib directory, and
> >> > prefix
> >> > is the effective --prefix.  (Which default of course to site-package and
> >> > sys.prefix respectively, but the spec shouldn't be in terms of those
> >> > defaults.)
> >>
> >> Just to make sure we agree on this:
> >>
> >> we use relative path if the file is in site-packages, or somewhere
> >> under sys.prefix. For the latter this is only if site-packages is
> >> under sys.prefix.
> >
> > Um, sys.prefix, or the prefix set by "setup.py install --prefix" (which of
> > course defaults to sys.prefix)?
>
>Yes, I used default values to make the text clearer.
>
>so for the PEP :
>
>- sys.prefix -> the installation prefix provided by --prefix at
>installation time
>- site-packages -> the installation libdir, provided by --install-lib
>at installation time

Yes.  Looking more closely at your example, though:

>Examples under debian:
>
>     docutils/__init__.py          ->     located in
>/usr/local/lib/python2.6/site-packages/
>     ../../../bin/rst2html.py       ->  located in /usr/local/bin
>     /etc/whatever                  ->     located in /etc

I'm wondering if there's really any benefit to having 
../../../bin/rst2html.py vs. /usr/local/bin/rst2html.py.  Was there a 
use case for that, or should we just go with relative paths ONLY for 
children of the libdir?

(I only suggested this setup in order to preserve as much of the 
prefix-relativity proposal as possible, but I wasn't the one who 
proposed prefix-relativity so I don't recall what the use case is, 
and I don't even remember who proposed it.  I only ever had a usecase 
for libdir-relativity personally.)



More information about the Python-Dev mailing list