Have fab env create with correct Python

This commit is contained in:
Matthew Honnibal 2018-02-28 01:45:19 +01:00
parent 7ade5160ca
commit d322c0ae8b
1 changed files with 6 additions and 3 deletions

9
fabfile.py vendored
View File

@ -34,11 +34,14 @@ def virtualenv(name, create=False, python='/usr/bin/python3.6'):
yield wrapped_local yield wrapped_local
def env(lang='python2.7'): def env(lang='python3.6'):
if VENV_DIR.exists(): if VENV_DIR.exists():
local('rm -rf {env}'.format(env=VENV_DIR)) local('rm -rf {env}'.format(env=VENV_DIR))
local('pip install virtualenv') local('{lang} -m pip install virtualenv'.format(lang=lang))
local('python -m virtualenv -p {lang} {env}'.format(lang=lang, env=VENV_DIR)) if lang.startswith('python3'):
local('{lang} -m venv {env}'.format(lang=lang, env=VENV_DIR))
else:
local('{lang} -m virtualenv {env}'.format(lang=lang, env=VENV_DIR))
def install(): def install():