[pypy-dev] [pypy-svn] r74850 - in pypy/branch/sys-prefix/lib: . pypy1.2 pypy1.2/lib_pypy pypy1.2/lib_pypy/app_test pypy1.2/lib_pypy/ctypes_config_cache pypy1.2/lib_pypy/test2

Antonio Cuni anto.cuni at gmail.com
Sat May 29 23:57:16 CEST 2010


Hi Maciek,

On 29/05/10 19:32, Maciej Fijalkowski wrote:
> Hm.
> 
> I might be missing something, but I thought sys.prefix is only meant
> for stuff after installation. If this is true (my CPython trunk build
> has sys.prefix == '/usr/local'), then modifying source checkout does
> not make any sense, since it's only about installation (which we don't
> really support anyway).

you are partly right. In CPython, sys.prefix is just an hard-coded string that
represent what was passed to ./configure; tools like virtualenv use it to find
the directories containing the stdlib, include files, etc. on the filesystem
(I'm not sure it's an entirely good idea, but this is the state of the things
and we have to face it).

However, nothing prevents the interpreter to set sys.prefix dynamically, e.g.
by searching for the directory that contains the stdlib in some location
relative to the pypy-c binary; this is what pypy-c does it already to set
sys.path.

The point of this branch is both:

1) to make it easier to install pypy system-wide: it will be enough to copy
pypy-c in /usr/bin and lib/pypy1.2 in /usr/lib (and of course we can automate
this with a script, if we want)

2) as holger pointed out, to make it possible to use virtualenv *without*
having to install pypy system-wide (which you cannot do with cpython, for
example): this will be possible because the directory hierarchy of the svn
checkout is designed in a way that setting sys.prefix to the the root of the
svn checkout will "just work"

ciao,
Anto



More information about the Pypy-dev mailing list