I'm working on pythonv[1], a branch which aims to bring virtual environment
creation functionality into Python itself (work on a PEP is in progress).

I've got a prototype working quite well on Linux and Windows [2], but not yet
done any work on OS X.

The basic approach used is that the Python start up code (in getpath.c) looks
at sys.executable and then for a configuration file env.cfg either in the
executable's directory or one level up, and then for a line in env.cfg of the
type

home = /path/to/python

If the file with that name and line are found, the home value sets sys.prefix
and sys.exec_prefix, and then later on, code in site.py sets up the virtual
environment.

Because of the use of sys.executable, at present pythonv makes a copy of the
executable (and, on Windows, all DLLs) in the environment's binaries folder.

My question is, will this approach work on OS X? I can't readily build and test
on an OS X system at the moment, so I'm hoping someone can enlighten me. If a
python executable file has sys.prefix/sys.exec_prefix pointing to a framework
build's location, will that give the virtual environment everything it needs
to e.g. interface to Cocoa etc? Or does any other setup need to be done?

Thanks and regards,

Vinay Sajip

[1] https://bitbucket.org/vinay.sajip/pythonv/
[2] http://www.red-dove.com/screencasts/pythonv/pythonv.html


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to