Stop using invoke and use make instead.

This commit is contained in:
Jannis Leidel
2014-12-13 00:03:13 +01:00
parent 67af0d89f9
commit c06506019f
5 changed files with 32 additions and 44 deletions

27
Makefile Normal file
View File

@@ -0,0 +1,27 @@
export DJANGO_SETTINGS_MODULE = tests.settings
export PYTHONPATH := $(shell pwd)
clean:
git clean -Xfd
maketranslations:
cd formtools; django-admin.py makemessages -a -v2
pulltranslations:
tx pull -a --minimum-perc=1
compiletranslations:
cd formtools; django-admin.py compilemessages
translations: pulltranslations maketranslations compiletranslations
@echo "Pulling, making and compiling translations"
docs:
$(MAKE) -C docs clean html
test:
@flake8 --ignore=W801,E128,E501,W402 formtools
@ coverage run `which django-admin.py` test tests
@coverage report
.PHONY: clean docs test maketranslations pulltranslations compiletranslations

View File

@@ -1,38 +0,0 @@
import os
import os.path
import sys
from invoke import run, task
@task
def clean():
run('git clean -Xfd')
@task
def test():
print('Python version: ' + sys.version)
test_cmd = 'coverage run `which django-admin.py` test --settings=tests.settings'
flake_cmd = 'flake8 --ignore=W801,E128,E501,W402'
# Fix issue #49
cwp = os.path.dirname(os.path.abspath(__name__))
pythonpath = os.environ.get('PYTHONPATH', '').split(os.pathsep)
pythonpath.append(os.path.join(cwp, 'tests'))
os.environ['PYTHONPATH'] = os.pathsep.join(pythonpath)
run('{0} formtools'.format(flake_cmd))
run('{0} tests'.format(test_cmd))
run('coverage report')
@task
def translations(pull=False):
if pull:
run('tx pull -a')
run('cd formtools; django-admin.py makemessages -a; django-admin compilemessages; cd ..')
@task
def docs():
run('cd docs; make html; cd ..')

View File

@@ -1,6 +1,2 @@
# invoke
# temporary fix for invoke on Python 3.2
invoke==0.9.0
coverage==3.7.1
flake8==2.2.3
six==1.8.0

View File

@@ -32,3 +32,6 @@ MIDDLEWARE_CLASSES = (
)
SITE_ID = 1
MEDIA_ROOT = 'media'
STATIC_ROOT = 'static'

View File

@@ -9,8 +9,8 @@ basepython =
py33: python3.3
py34: python3.4
usedevelop = true
commands =
invoke test {posargs}
whitelist_externals = make
commands = make test
deps =
django-17: Django>=1.7,<1.8
django-master: https://github.com/django/django/archive/master.zip