mirror of https://github.com/explosion/spaCy.git
Improve fabfile
This commit is contained in:
parent
7cf6b1c7a4
commit
80e9c6bac7
|
@ -14,15 +14,14 @@ VENV_DIR = Path(PWD) / ENV
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def virtualenv(name, create=False, python='/usr/bin/python3.6', capture=False):
|
def virtualenv(name, create=False, python='/usr/bin/python3.6'):
|
||||||
python = Path(python).resolve()
|
python = Path(python).resolve()
|
||||||
env_path = VENV_DIR
|
env_path = VENV_DIR
|
||||||
if create:
|
if create:
|
||||||
if env_path.exists():
|
if env_path.exists():
|
||||||
shutil.rmtree(str(env_path))
|
shutil.rmtree(str(env_path))
|
||||||
local('{python} -m venv {env_path}'.format(python=python, env_path=VENV_DIR),
|
local('{python} -m venv {env_path}'.format(python=python, env_path=VENV_DIR))
|
||||||
capture=capture)
|
def wrapped_local(cmd, env_vars=[], capture=False):
|
||||||
def wrapped_local(cmd, env_vars=[]):
|
|
||||||
env_py = env_path / 'bin' / 'python'
|
env_py = env_path / 'bin' / 'python'
|
||||||
env_vars = ' '.join(env_vars)
|
env_vars = ' '.join(env_vars)
|
||||||
if cmd.split()[0] == 'python':
|
if cmd.split()[0] == 'python':
|
||||||
|
|
Loading…
Reference in New Issue