Improve fabfile

This commit is contained in:
Matthew Honnibal 2018-02-28 11:56:09 +01:00
parent 1b840f1ac1
commit 7521f85014
1 changed files with 4 additions and 5 deletions

9
fabfile.py vendored
View File

@ -42,19 +42,20 @@ def env(lang='python3.6'):
local('{lang} -m venv {env}'.format(lang=lang, env=VENV_DIR)) local('{lang} -m venv {env}'.format(lang=lang, env=VENV_DIR))
else: else:
local('{lang} -m virtualenv {env}'.format(lang=lang, env=VENV_DIR)) local('{lang} -m virtualenv {env}'.format(lang=lang, env=VENV_DIR))
with virtualenv(VENV_DIR) as venv_local:
venv_local('python --version')
venv_local('pip install --upgrade setuptools')
venv_local('pip install pytest')
def install(): def install():
with virtualenv(VENV_DIR) as venv_local: with virtualenv(VENV_DIR) as venv_local:
venv_local('pip install --upgrade setuptools')
venv_local('pip install dist/*.tar.gz') venv_local('pip install dist/*.tar.gz')
venv_local('pip install pytest')
def make(): def make():
with virtualenv(VENV_DIR) as venv_local: with virtualenv(VENV_DIR) as venv_local:
with lcd(path.dirname(__file__)): with lcd(path.dirname(__file__)):
venv_local('pip install cython')
venv_local('pip install -r requirements.txt') venv_local('pip install -r requirements.txt')
venv_local('python setup.py build_ext --inplace', env_vars=['PYTHONPATH=`pwd`']) venv_local('python setup.py build_ext --inplace', env_vars=['PYTHONPATH=`pwd`'])
@ -66,7 +67,6 @@ def sdist():
def wheel(): def wheel():
with virtualenv(VENV_DIR) as venv_local: with virtualenv(VENV_DIR) as venv_local:
with lcd(path.dirname(__file__)): with lcd(path.dirname(__file__)):
venv_local('pip install wheel')
venv_local('python setup.py bdist_wheel') venv_local('python setup.py bdist_wheel')
@ -79,5 +79,4 @@ def clean():
def test(): def test():
with virtualenv(VENV_DIR) as venv_local: with virtualenv(VENV_DIR) as venv_local:
with lcd(path.dirname(__file__)): with lcd(path.dirname(__file__)):
venv_local('pip install pytest')
venv_local('pytest -x spacy/tests') venv_local('pytest -x spacy/tests')