added python3 support to pip virtualenv setup
This commit is contained in:
parent
33b11f3df8
commit
73bdebbf1a
1 changed files with 13 additions and 4 deletions
|
|
@ -13,7 +13,7 @@ ERROR_BAD_PARAM = -2
|
|||
|
||||
|
||||
@task
|
||||
def setup_virtualenv():
|
||||
def setup_virtualenv(python3=False):
|
||||
configuration = env.config
|
||||
|
||||
if env.debug:
|
||||
|
|
@ -21,11 +21,18 @@ def setup_virtualenv():
|
|||
format='\n%(levelname)s: deploy.setup_virtualenv %(message)s',
|
||||
level=logging.DEBUG)
|
||||
|
||||
mkvirtualenv_cmd = "mkvirtualenv --no-site-packages " \
|
||||
"{virtualenv_name}".format(
|
||||
mkvirtualenv_cmd = "mkvirtualenv --no-site-packages "
|
||||
|
||||
if python3:
|
||||
mkvirtualenv_cmd += "--python=python3 "
|
||||
|
||||
mkvirtualenv_cmd += "{virtualenv_name}".format(
|
||||
virtualenv_name=configuration.virtualenv.name)
|
||||
|
||||
if env.debug:
|
||||
|
||||
logging.debug("python3 install: %s" % python3)
|
||||
|
||||
logging.debug("virtualenv.workon : %s"
|
||||
% configuration.virtualenv.workon)
|
||||
|
||||
|
|
@ -41,6 +48,8 @@ def setup_virtualenv():
|
|||
logging.debug("virtualenv.paths.root : %s"
|
||||
% configuration.virtualenv.paths.root)
|
||||
|
||||
logging.debug("mkvirtualenv_cmd: %s" % mkvirtualenv_cmd)
|
||||
|
||||
logging.debug("with virtualenv_source(): run(\"\n\t%s\n\t\")".format(
|
||||
mkvirtualenv_cmd))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue