-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.42 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
PROJECT_PATH = ./idb/
TEST_PATH = ./tests/
HELP_FUN = \
%help; while(<>){push@{$$help{$$2//'options'}},[$$1,$$3] \
if/^([\w-_]+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/}; \
print"$$_:\n", map" $$_->[0]".(" "x(20-length($$_->[0])))."$$_->[1]\n",\
@{$$help{$$_}},"\n" for keys %help; \
help: ##@Help Show this help
@echo -e "Usage: make [target] ...\n"
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
lint-ci: flake ruff bandit mypy ##@Linting Run all linters in CI
flake: ##@Linting Run flake8
.venv/bin/flake8 --max-line-length 88 --format=default $(PROJECT_PATH) 2>&1 | tee flake8.txt
ruff: ##@Linting Run ruff
.venv/bin/ruff check $(PROJECT_PATH)
bandit: ##@Linting Run bandit
.venv/bin/bandit -r -ll -iii $(PROJECT_PATH) -f json -o ./bandit.json
mypy: ##@Linting Run mypy
.venv/bin/mypy --config-file ./pyproject.toml $(PROJECT_PATH)
test: ##@Test Run tests with pytest
pytest -vvx $(TEST_PATH)
test-ci: ##@Test Run tests with pytest and coverage in CI
.venv/bin/pytest $(TEST_PATH) --junitxml=./junit.xml --cov=$(PROJECT_PATH) --cov-report=xml
develop: #
python -m venv .venv
.venv/bin/pip install -U pip poetry
.venv/bin/poetry config virtualenvs.create false
.venv/bin/poetry install
local: ##@Develop Run db and redis containers
docker-compose -f docker-compose.dev.yaml up --force-recreate --renew-anon-volumes --build
local_down: ##@Develop Stop containers with delete volumes
docker-compose -f docker-compose.dev.yaml down -v