2017-01-14 20:30:36 +00:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals, print_function
|
2015-10-25 12:15:51 +00:00
|
|
|
|
2015-07-26 20:40:04 +00:00
|
|
|
from fabric.api import local, lcd, env, settings, prefix
|
2015-01-04 18:30:24 +00:00
|
|
|
from fabtools.python import virtualenv
|
2017-01-14 20:30:36 +00:00
|
|
|
from os import path, environ
|
2014-09-11 10:28:38 +00:00
|
|
|
|
2015-01-03 10:02:21 +00:00
|
|
|
|
|
|
|
PWD = path.dirname(__file__)
|
2017-01-14 20:30:36 +00:00
|
|
|
ENV = environ['VENV_DIR'] if 'VENV_DIR' in environ else '.env'
|
2017-01-14 16:49:32 +00:00
|
|
|
VENV_DIR = path.join(PWD, ENV)
|
2015-01-03 10:02:21 +00:00
|
|
|
|
|
|
|
|
2017-01-14 20:30:36 +00:00
|
|
|
def env(lang='python2.7'):
|
|
|
|
if path.exists(VENV_DIR):
|
2017-01-14 16:49:32 +00:00
|
|
|
local('rm -rf {env}'.format(env=VENV_DIR))
|
2017-04-15 13:43:38 +00:00
|
|
|
local('python -m virtualenv -p {lang} {env}'.format(lang=lang, env=VENV_DIR))
|
2015-01-03 10:02:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
def install():
|
|
|
|
with virtualenv(VENV_DIR):
|
2015-01-04 18:30:24 +00:00
|
|
|
local('pip install --upgrade setuptools')
|
2015-01-03 10:02:21 +00:00
|
|
|
local('pip install dist/*.tar.gz')
|
|
|
|
local('pip install pytest')
|
|
|
|
|
2014-07-05 18:49:34 +00:00
|
|
|
|
|
|
|
def make():
|
2015-01-05 16:24:27 +00:00
|
|
|
with virtualenv(VENV_DIR):
|
2015-01-03 10:02:21 +00:00
|
|
|
with lcd(path.dirname(__file__)):
|
2015-01-05 16:24:27 +00:00
|
|
|
local('pip install cython')
|
|
|
|
local('pip install murmurhash')
|
|
|
|
local('pip install -r requirements.txt')
|
2015-01-04 18:30:24 +00:00
|
|
|
local('python setup.py build_ext --inplace')
|
2015-01-03 10:02:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
def clean():
|
|
|
|
with lcd(path.dirname(__file__)):
|
2015-01-25 03:49:29 +00:00
|
|
|
local('python setup.py clean --all')
|
2015-01-03 10:02:21 +00:00
|
|
|
|
2014-07-05 18:49:34 +00:00
|
|
|
|
2015-01-03 10:02:21 +00:00
|
|
|
def test():
|
|
|
|
with virtualenv(VENV_DIR):
|
|
|
|
with lcd(path.dirname(__file__)):
|
2015-11-03 05:39:30 +00:00
|
|
|
local('py.test -x spacy/tests')
|