Stop using invoke and use make instead.
This commit is contained in:
27
Makefile
Normal file
27
Makefile
Normal 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
|
||||
38
tasks.py
38
tasks.py
@@ -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 ..')
|
||||
@@ -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
|
||||
|
||||
@@ -32,3 +32,6 @@ MIDDLEWARE_CLASSES = (
|
||||
)
|
||||
|
||||
SITE_ID = 1
|
||||
|
||||
MEDIA_ROOT = 'media'
|
||||
STATIC_ROOT = 'static'
|
||||
|
||||
Reference in New Issue
Block a user