* Fabfile changes

This commit is contained in:
Matthew Honnibal 2015-01-03 21:02:21 +11:00
parent a179f1fc52
commit e5d4b5faf4

61
fabfile.py vendored
View File

@ -1,15 +1,67 @@
from fabric.api import local, run, lcd, cd, env
from os.path import exists as file_exists
from fabtools.python import virtualenv
from os import path
import json import json
from fabric.api import local, run, lcd, cd, env
PWD = path.dirname(__file__)
VENV_DIR = path.join(PWD, '.env')
def sdist():
if file_exists('dist/'):
local('rm -rf dist/')
local('mkdir dist')
with virtualenv(VENV_DIR):
local('pip install --upgrade setuptools')
local('pip install murmurhash')
local('pip install numpy')
local('python setup.py sdist')
def publish():
with virtualenv(VENV_DIR):
local('python setup.py register')
local('twine upload dist/*.tar.gz')
def setup():
if file_exists('.env'):
local('rm -rf .env')
local('virtualenv .env')
def install():
with virtualenv(VENV_DIR):
local('pip install dist/*.tar.gz')
local('pip install pytest')
def make(): def make():
local('python setup.py build_ext --inplace > /dev/null 2> /tmp/err') with virtualenv(VENV_DIR):
with lcd(path.dirname(__file__)):
local('python dev_setup.py build_ext --inplace > /dev/null')
def vmake(): def vmake():
local('python setup.py build_ext --inplace') with virtualenv(VENV_DIR):
with lcd(path.dirname(__file__)):
local('python dev_setup.py build_ext --inplace')
def clean():
with lcd(path.dirname(__file__)):
local('python dev_setup.py clean --all')
def test():
with virtualenv(VENV_DIR):
with lcd(path.dirname(__file__)):
local('py.test -x')
def clean(): def clean():
local('python setup.py clean --all') local('python setup.py clean --all')
@ -18,12 +70,11 @@ def docs():
with lcd('docs'): with lcd('docs'):
local('make html') local('make html')
def test():
local('py.test -x')
def sbox(): def sbox():
local('python sb_setup.py build_ext --inplace') local('python sb_setup.py build_ext --inplace')
def sbclean(): def sbclean():
local('python sb_setup.py clean --all') local('python sb_setup.py clean --all')