2015-10-25 15:15:51 +03:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2015-07-26 23:40:04 +03:00
|
|
|
from fabric.api import local, lcd, env, settings, prefix
|
2015-01-03 13:02:21 +03:00
|
|
|
from os.path import exists as file_exists
|
2015-01-04 21:30:24 +03:00
|
|
|
from fabtools.python import virtualenv
|
2015-01-03 13:02:21 +03:00
|
|
|
from os import path
|
2015-07-26 23:40:04 +03:00
|
|
|
import os
|
|
|
|
import shutil
|
2015-10-25 15:15:51 +03:00
|
|
|
from pathlib import Path
|
2014-09-11 14:28:38 +04:00
|
|
|
|
2015-01-03 13:02:21 +03:00
|
|
|
|
|
|
|
PWD = path.dirname(__file__)
|
|
|
|
VENV_DIR = path.join(PWD, '.env')
|
|
|
|
|
|
|
|
|
2015-01-05 19:24:27 +03:00
|
|
|
def env(lang="python2.7"):
|
2015-01-03 13:02:21 +03:00
|
|
|
if file_exists('.env'):
|
|
|
|
local('rm -rf .env')
|
2015-01-05 19:24:27 +03:00
|
|
|
local('virtualenv -p %s .env' % lang)
|
2015-01-03 13:02:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
def install():
|
|
|
|
with virtualenv(VENV_DIR):
|
2015-01-04 21:30:24 +03:00
|
|
|
local('pip install --upgrade setuptools')
|
2015-01-03 13:02:21 +03:00
|
|
|
local('pip install dist/*.tar.gz')
|
|
|
|
local('pip install pytest')
|
|
|
|
|
2014-07-05 22:49:34 +04:00
|
|
|
|
|
|
|
def make():
|
2015-01-05 19:24:27 +03:00
|
|
|
with virtualenv(VENV_DIR):
|
2015-01-03 13:02:21 +03:00
|
|
|
with lcd(path.dirname(__file__)):
|
2015-01-05 19:24:27 +03:00
|
|
|
local('pip install cython')
|
|
|
|
local('pip install murmurhash')
|
|
|
|
local('pip install -r requirements.txt')
|
2015-01-04 21:30:24 +03:00
|
|
|
local('python setup.py build_ext --inplace')
|
2015-01-03 13:02:21 +03:00
|
|
|
|
|
|
|
|
|
|
|
def clean():
|
|
|
|
with lcd(path.dirname(__file__)):
|
2015-01-25 06:49:29 +03:00
|
|
|
local('python setup.py clean --all')
|
2015-01-03 13:02:21 +03:00
|
|
|
|
2014-07-05 22:49:34 +04:00
|
|
|
|
2015-01-03 13:02:21 +03:00
|
|
|
def test():
|
|
|
|
with virtualenv(VENV_DIR):
|
|
|
|
with lcd(path.dirname(__file__)):
|
2015-11-03 08:39:30 +03:00
|
|
|
local('py.test -x spacy/tests')
|