[Python-Dev] draft PEP: virtual environments

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Nov 1 09:15:40 CET 2011


Martin v. Löwis <martin <at> v.loewis.de> writes:

> I'm not sure how many scripts you are talking about, and how long they
> are. Assuming there are free, and assuming they are short, I'd not make
> them separate source files again, but put them into string literals instead:
> 
> scripts = {
>   'start':'''\
> #!/bin/sh
> echo start
> ''',
>   'stop':'''\
> #!/bin/sh
> echo stop
> '''
> }}}
> 
> Then, your install_scripts would take a dictionary filename:script
> contents. That's just as easily extensible.

True, but while the default scripts are not *too* long, third party scripts
might be not amenable to this treatment. Plus, there can be binary executables
in there too: at the moment, the pysetup3 script on Windows is shipped as a stub
executable pysetup3.exe and a script pysetup3-script.py (since we can't rely on
the PEP 397 launcher being available, this is the only way of being sure that
the correct Python gets to run the script).

I've changed the implementation now to use a directory tree, and the API takes
the absolute pathname of the directory containing the scripts.

Regards,

Vinay Sajip



More information about the Python-Dev mailing list