-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
57 lines (43 loc) · 2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
BUILDDIR=./~build
DJANGO_14:='django>=1.4,<1.5'
DJANGO_15:='django>=1.5,<1.6'
DJANGO_16:='django>=1.6,<1.7'
DJANGO_17=https://www.djangoproject.com/download/1.7c1/tarball/
DJANGO_DEV=git+git://github.com/django/django.git
DBNAME=geo
DBENGINE?=postgres
mkbuilddir:
mkdir -p ${BUILDDIR}/cache
install-deps:
@pip install -q \
-r geo/requirements/install.pip \
-r geo/requirements/testing.pip \
python-coveralls==2.4.2
test: mkbuilddir
py.test -vvv
clean:
rm -fr ${BUILDDIR} dist *.egg-info .coverage
find . -name __pycache__ -o -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
find geo/locale -name django.mo | xargs rm -f
coverage: mkbuilddir
py.test --cov=geo --cov-report=html --cov-report=term --cov-config=tests/.coveragerc -vvv
demo:
django-admin.py syncdb --settings=tests.settings
django-admin.py runserver --settings=tests.settings
init-db:
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS ${DBNAME};'; fi"
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS ${DBNAME};'; fi"
@sh -c "if [ '${DBENGINE}' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS ${DBNAME};' -U postgres; fi"
@sh -c "if [ '${DBENGINE}' = 'postgres' ]; then psql -c 'CREATE DATABASE ${DBNAME};' -U postgres; fi"
@sh -c "if [ '${DBENGINE}' = 'postgres' ]; then pip install -q psycopg2; fi"
ci: init-db install-deps
@sh -c "if [ '${DJANGO}' = '1.4.x' ]; then pip install ${DJANGO_14}; fi"
@sh -c "if [ '${DJANGO}' = '1.5.x' ]; then pip install ${DJANGO_15}; fi"
@sh -c "if [ '${DJANGO}' = '1.6.x' ]; then pip install ${DJANGO_16}; fi"
@sh -c "if [ '${DJANGO}' = '1.7.x' ]; then pip install ${DJANGO_17}; fi"
@sh -c "if [ '${DJANGO}' = 'dev' ]; then pip install ${DJANGO_DEV}; fi"
@pip install coverage
@python -c "from __future__ import print_function;import django;print('Django version:', django.get_version())"
@echo "Database:" ${DBENGINE}
$(MAKE) coverage