#NEWLINE# def make_env( * packages ) : #NEWLINE# #INDENT# 'Make a virtualenv\n    \n    Assumes `which python` has the `virtualenv` package\n    ' #NEWLINE# if ( not os . path . exists ( env_root ) ) : #NEWLINE# #INDENT# os . makedirs ( env_root ) #NEWLINE# #UNINDENT# env = os . path . join ( env_root , os . path . basename ( py_exe ) ) #NEWLINE# py = pjoin ( env , 'bin' , 'python' ) #NEWLINE# if ( not os . path . exists ( py ) ) : #NEWLINE# #INDENT# run ( 'python -m virtualenv {} -p {}' . format ( pipes . quote ( env ) , pipes . quote ( py_exe ) ) ) #NEWLINE# py = pjoin ( env , 'bin' , 'python' ) #NEWLINE# run ( [ py , '-V' ] ) #NEWLINE# install ( py , 'pip' , 'setuptools' ) #NEWLINE# #UNINDENT# if packages : #NEWLINE# #INDENT# install ( packages , * packages ) #NEWLINE# #UNINDENT# return py