[Python-Dev] Python install layout and the PATH on win32

Carl Meyer carl at oddbird.net
Fri Mar 16 21:22:03 CET 2012


Hi Van,

On 03/16/2012 08:08 AM, Lindberg, Van wrote:
>> Changing the directory name is in fact a new and different (and much
>> more invasive) special case, because distutils et al install scripts
>> there, and that directory name is part of the distutils install scheme.
>> Installers don't care where the Python binary is located, so moving it
>> in with the other scripts has very little impact.
> 
> So would changing the distutils install scheme in 3.3 - as defined and 
> declared by distutils - lead to a change in your code?
> 
> Alternatively stated, do you independently figure out that your 
> virtualenv is on Windows and then put things in Scripts, etc, or do you 
> use sysconfig? If sysconfig gave you different (consistent) values 
> across platforms, how would that affect your code?

Both virtualenv and PEP 405 pyvenv figure out the platform at
venv-creation time, and hard-code certain information about the correct
layout for that platform (Scripts vs bin, as well as lib/pythonx.x vs
Lib), so the internal layout of the venv matches the system layout on
that platform. The key fact is that there is then no special-casing
necessary when code runs within the virtualenv (particularly installer
code); the same install scheme that would work in the system Python will
also Just Work in the virtualenv.

I'm not concerned about changes to distutils/sysconfig install schems to
make them more compatible across platforms from the POV of virtualenv;
we can easily update the current platform-detection code to do the right
thing depending on both platform and Python version.

I do share Éric's concern about whether distutils' legacy install
schemes would be updated or not, and how this would affect backwards
compatibility for older installer code, but that's pretty much
orthogonal to virtualenv/pyvenv.

I don't want to make the internal layout of a virtualenv differ from the
system Python layout on the same platform, which (IIUC) was Mark's proposal.

Hope that clarifies,

Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120316/b28ab254/attachment.pgp>


More information about the Python-Dev mailing list