-
Notifications
You must be signed in to change notification settings - Fork 49
/
Makefile
53 lines (39 loc) · 1.54 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
VERSION=2.0.0
BUILDDIR='~build'
PYTHONPATH:=${PWD}/tests/:${PWD}
DBENGINE?=pg
DJANGO?='last'
.mkbuilddir:
mkdir -p ${BUILDDIR}
develop:
@pip install pipenv
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then pip install MySQL-python; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then pip install -q psycopg2-binary; fi"
$(MAKE) .init-db
@pipenv install -d --skip-lock
.init-db:
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -h 127.0.0.1 -u root -e 'DROP DATABASE IF EXISTS concurrency;'; fi"
@sh -c "if [ '${DBENGINE}' = 'mysql' ]; then mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE IF NOT EXISTS concurrency;'; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -h localhost -c 'DROP DATABASE IF EXISTS concurrency;' -U postgres; fi"
@sh -c "if [ '${DBENGINE}' = 'pg' ]; then psql -h localhost -c 'CREATE DATABASE concurrency;' -U postgres; fi"
test:
py.test -v --create-db
lint:
pre-commit run --all-files
travis:
docker run --privileged --name travis-debug -it -u travis travisci/ci-amethyst:packer-1512508255-986baf0 /bin/bash -l
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
rm -fr ${BUILDDIR}/docs/*
sphinx-build -aE docs/ ${BUILDDIR}/docs
ifdef BROWSE
firefox ${BUILDDIR}/docs/index.html
endif