-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (46 loc) · 1.48 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
.PHONY: init init_poetry python test_all test_verbose coverage generate_changelog \
generate_version safety_check lint type_check formatting test coverage_ci start
.DEFAULT_GOAL := init
# Container
init: init_poetry
init_poetry: ../.poetry_check
poetry.lock: pyproject.toml
poetry lock
@touch $@
../.poetry_check: poetry.lock
poetry install
@touch $@
# Development
python:
@poetry --quiet run python
test_all: safety_check lint type_check formatting test coverage
test_verbose:
@poetry run pytest --durations=5 -vv
coverage:
@poetry run pytest --cov-report term --cov-report xml:../coverage.xml --cov=cibo
@rm .coverage
generate_changelog:
@GITCHANGELOG_CONFIG_FILENAME=./.gitchangelog/.gitchangelog.rc \
poetry run gitchangelog | tee CHANGELOG.md
generate_version:
@poetry run dunamai from git --bump --no-metadata \
--pattern "^(?P<base>\d+(\.\d+)*)([-]?(?P<stage>[a-zA-Z-]+))(\.)(?P<revision>[0-9]+)" \
--format "{base}-{stage}.{revision}"
# Quality Control
safety_check:
@poetry export --without-hashes --with dev -o requirements.txt && cat requirements.txt \
| poetry run safety check --stdin --full-report && poetry check -n
@rm requirements.txt
lint:
@poetry run pylint ./cibo ./tests
type_check:
@poetry run mypy
formatting:
@poetry run black --diff --check ./cibo ./tests
test:
@poetry run pytest --durations=5
coverage_ci:
@poetry run pytest --cov-report term --cov-report xml:coverage.xml --cov=cibo
# Server
start:
@poetry --quiet run python ./cibo