-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 1.01 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
PKG=api
.PHONY: all clean version init flake8 pylint lint test coverage
init: clean
pipenv --python 3.7
pipenv install
git submodule update --init --remote
dev: init
pipenv install --dev
# pipenv run pre-commit install -t commit-msg
service_up:
cd database && make service_up && sleep 1 && make migrate
docker-compose run -d grafana && \
docker-compose run -d redis
service_down:
cd database && make service_down
docker-compose down && \
docker volume rm redis_data grafana_data
commit:
pipenv run cz commit
flake8:
pipenv run flake8
pylint:
pipenv run pylint $(PKG) --rcfile=setup.cfg
black:
pipenv run black $(PKG) --skip-string-normalization -l 120
isort:
pipenv run isort --recursive --apply
lint: flake8 pylint
build:
docker-compose build
run:
cd ${PKG} && pipenv run python app.py
clean:
find . -type f -name '*.py[co]' -delete
find . -type d -name '__pycache__' -delete
db_migrate:
pipenv run python ${PKG}/manage.py db migrate
db_upgrate:
pipenv run python ${PKG}/manage.py db upgrade