* Upd fabfile

This commit is contained in:
Matthew Honnibal 2015-01-05 05:30:24 +11:00
parent e0c85371d1
commit e0711d7024

36
fabfile.py vendored
View File

@ -1,8 +1,7 @@
from fabric.api import local, run, lcd, cd, env from fabric.api import local, run, lcd, cd, env
from os.path import exists as file_exists from os.path import exists as file_exists
from fabtools.python import install, is_installed, virtualenv, install_requirements from fabtools.python import virtualenv
from os import path from os import path
import json
PWD = path.dirname(__file__) PWD = path.dirname(__file__)
@ -10,20 +9,16 @@ VENV_DIR = path.join(PWD, '.env')
DEV_ENV_DIR = path.join(PWD, '.denv') DEV_ENV_DIR = path.join(PWD, '.denv')
def require_dep(name):
local('pip install %s' % name)
def dev(): def dev():
# Allow this to persist, since we aren't as rigorous about keeping state clean # Allow this to persist, since we aren't as rigorous about keeping state clean
if not file_exists('.denv'): if not file_exists('.denv'):
local('virtualenv .denv') local('virtualenv .denv')
with virtualenv(DEV_ENV_DIR): with virtualenv(DEV_ENV_DIR):
require_dep('cython') local('pip install cython')
require_dep('murmurhash') local('pip install murmurhash')
require_dep('numpy') local('pip install -r dev_requirements.txt')
local('pip install -r requirements.txt')
def sdist(): def sdist():
@ -44,12 +39,11 @@ def setup():
if file_exists('.env'): if file_exists('.env'):
local('rm -rf .env') local('rm -rf .env')
local('virtualenv .env') local('virtualenv .env')
with virtualenv(VENV_DIR):
local('pip install --upgrade setuptools')
def install(): def install():
with virtualenv(VENV_DIR): with virtualenv(VENV_DIR):
local('pip install --upgrade setuptools')
local('pip install dist/*.tar.gz') local('pip install dist/*.tar.gz')
local('pip install pytest') local('pip install pytest')
@ -57,14 +51,7 @@ def install():
def make(): def make():
with virtualenv(DEV_ENV_DIR): with virtualenv(DEV_ENV_DIR):
with lcd(path.dirname(__file__)): with lcd(path.dirname(__file__)):
local('python dev_setup.py build_ext --inplace > /dev/null') local('python setup.py build_ext --inplace')
def vmake():
with virtualenv(VENV_DIR):
with lcd(path.dirname(__file__)):
local('python dev_setup.py build_ext --inplace')
def clean(): def clean():
@ -78,13 +65,8 @@ def test():
local('py.test -x') local('py.test -x')
def clean(): def travis():
local('python setup.py clean --all') local('open https://travis-ci.org/honnibal/thinc')
def docs():
with lcd('docs'):
local('make html')
def pos(): def pos():