Allow control of virtualenv in fabfile via environment variable

This commit is contained in:
Ines Montani 2017-01-14 17:49:32 +01:00
parent a89e269a5a
commit 258e322e9c

9
fabfile.py vendored
View File

@ -10,13 +10,14 @@ from pathlib import Path
PWD = path.dirname(__file__) PWD = path.dirname(__file__)
VENV_DIR = path.join(PWD, '.env') ENV = os.environ["VENV_DIR"] if 'VENV_DIR' in os.environ else '.env'
VENV_DIR = path.join(PWD, ENV)
def env(lang="python2.7"): def env(lang="python2.7"):
if file_exists('.env'): if file_exists(VENV_DIR):
local('rm -rf .env') local('rm -rf {env}'.format(env=VENV_DIR))
local('virtualenv -p %s .env' % lang) local('virtualenv -p {lang} {env}'.format(lang=lang, env=VENV_DIR))
def install(): def install():