[Python-Dev] In-Python virtualisation and packaging

Ronald Oussoren ronaldoussoren at mac.com
Tue Jun 14 11:44:45 CEST 2011


On 14 Jun, 2011, at 11:15, Jannis Leidel wrote:

> 
> On 14.06.2011, at 01:46, Carl Meyer wrote:
> 
>> 
>> In fact, the only new-OS-version adjustment I can recall virtualenv
>> needing to make is when Debian introduced dist-packages -- but even that
>> doesn't really apply, as that was distro-packager change to Python
>> itself. With a built-in virtualenv it would be the distro packagers
>> responsibility to make sure their patch to Python doesn't break the
>> virtualenv module.
> 
> FTR, there is some special casing for Mac OS framework installs included, too.
> Not sure if that should be considered a stability threatening issue though
> since Apple hasn't changed much on that layout, AFAIK.

Apple hasn't changed anything w.r.t. the basic layout of frameworks for a long time, but does mess with the structure of site-packages in their releases of Python. That shouldn't affect this feature though.

For the most part a Python.framework is just a unix install stuffed inside framework. The special-case code in virtualenv for frameworks is needed because a framework uses another mechanism to look for sys.prefix than a classical unix install: sys.prefix is the directory that contains the python shared library.

There is another feature of a framework install that would be nice to have in a virtualenv:  the python and pythonw commands for a framework build are small programs that use execv to start the real interpreter that's stored in a Python.app inside the framework. This is needed to be able to access GUI functionality from the command-line as Apple's GUI frameworks assume they are used by code in an application bundle. 

Ronald


More information about the Python-Dev mailing list