From c06506019f9be2e9ccf7d2f0d123541744223de4 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 13 Dec 2014 00:03:13 +0100 Subject: [PATCH] Stop using invoke and use make instead. --- Makefile | 27 +++++++++++++++++++++++++++ tasks.py | 38 -------------------------------------- tests/requirements.txt | 4 ---- tests/settings.py | 3 +++ tox.ini | 4 ++-- 5 files changed, 32 insertions(+), 44 deletions(-) create mode 100644 Makefile delete mode 100644 tasks.py diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1d452fc --- /dev/null +++ b/Makefile @@ -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 diff --git a/tasks.py b/tasks.py deleted file mode 100644 index 7119395..0000000 --- a/tasks.py +++ /dev/null @@ -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 ..') diff --git a/tests/requirements.txt b/tests/requirements.txt index 7885ef2..657ac03 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -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 diff --git a/tests/settings.py b/tests/settings.py index 8cdbb7d..369e937 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -32,3 +32,6 @@ MIDDLEWARE_CLASSES = ( ) SITE_ID = 1 + +MEDIA_ROOT = 'media' +STATIC_ROOT = 'static' diff --git a/tox.ini b/tox.ini index cbe596e..91e14f5 100644 --- a/tox.ini +++ b/tox.ini @@ -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