-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
80 lines (64 loc) · 2.18 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
maVERSION=2.0.0
BUILDDIR=${PWD}/~build
BINDIR=${PWD}/~build/bin
export PYTHONPATH:=${PWD}/tests/:${PWD}/src
DJANGO?='1.7.x'
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z0-9_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("\033[93m%-10s\033[0m %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
.mkbuilddir:
@mkdir -p ${BUILDDIR}
lint: ## code lint
tox -e lint
#pre-commit run --all-files
develop: ## setup development env
python3 -m venv ./.venv
./.venv/bin/pip install -r src/requirements/testing.pip
./.venv/bin/pip install -r src/requirements/develop.pip
demo: ## run demo app
cd tests/demoapp && python manage.py makemigrations demo
cd tests/demoapp && python manage.py init_demo
cd tests/demoapp && python manage.py runserver
clean: ## clean development directory
rm -fr ${BUILDDIR} dist *.egg-info .coverage coverage.xml pytest.xml .cache MANIFEST build .pytest_cache
find . -name __pycache__ | xargs rm -rf
find . -name "*.py?" -o -name "*.orig" -prune | xargs rm -rf
fullclean: ## clean development directory
rm -fr .tox .cache
rm -fr *.sqlite
$(MAKE) clean
test: ## run test
py.test src tests -vv --capture=no --doctest-modules --cov=adminfilters --cov-report=html --cov-config=tests/.coveragerc
docs: .mkbuilddir
@sh docs/to_gif.sh docs/images
@mkdir -p ${BUILDDIR}/docs
sphinx-build -aE docs ${BUILDDIR}/docs
bump: ## Bumps version
@while :; do \
read -r -p "bumpversion [major/minor/release]: " PART; \
case "$$PART" in \
major|minor|release) break ;; \
esac \
done ; \
bumpversion --no-commit --allow-dirty $$PART
@grep "^VERSION " src/adminfilters/__init__.py
heroku:
@git checkout heroku
@git merge develop -m "merge develop"
@git push heroku heroku:master
@git checkout develop
@echo "check demo at https://django-adminfilters.herokuapp.com/"
heroku-reset: heroku
heroku pg:reset --confirm django-adminfilters
heroku config:set DEBUG=true
heroku run python tests/demoapp/manage.py migrate
heroku run python tests/demoapp/manage.py init_demo
heroku run python tests/demoapp/manage.py collectstatic --noinput