forked from saxix/django-concurrency
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.37 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.37 KB
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
VERSION=2.0.0
BUILDDIR='~build'
PYTHONPATH:=${PWD}/tests/:${PWD}
DBENGINE?=pg
DJANGO?='last'
.mkbuilddir:
mkdir -p ${BUILDDIR}
develop:
@pip install -U pip setuptools
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then pip install -q psycopg2; fi"
@pip install -e .[dev]
$(MAKE) .init-db
.init-db:
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -u root -e 'DROP DATABASE IF EXISTS concurrency;'; fi"
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE IF NOT EXISTS concurrency;'; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -c 'CREATE DATABASE concurrency;' -U postgres; fi"
test:
py.test -v --create-db
qa:
flake8 src/ tests/
isort -rc src/ --check-only
check-manifest
clean:
rm -fr ${BUILDDIR} dist *.egg-info .coverage coverage.xml .eggs
find src -name __pycache__ -o -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
find tests -name __pycache__ -o -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
find src/concurrency/locale -name django.mo | xargs rm -f
fullclean:
rm -fr .tox .cache
$(MAKE) clean
docs: .mkbuilddir
mkdir -p ${BUILDDIR}/docs
sphinx-build -aE docs/ ${BUILDDIR}/docs
ifdef BROWSE
firefox ${BUILDDIR}/docs/index.html
endif