-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
59 lines (47 loc) · 1.47 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
# https://stackoverflow.com/a/26339924
.PHONY: list
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
%:
@:
#* Poetry
.PHONY: poetry-download
poetry-download:
curl -sSL https://install.python-poetry.org | python
.PHONY: poetry-remove
poetry-remove:
curl -sSL https://install.python-poetry.org | python --uninstall
#* Installation
.PHONY: install
install:
poetry install -n --sync
.PHONY: pre-commit-install
pre-commit-install:
poetry run pre-commit install
#* Formatters
.PHONY: format
fmt format:
poetry run ruff format $(filter-out $@,$(MAKECMDGOALS))
#* Linting
.PHONY: test
test:
poetry run pytest -c pyproject.toml tests
.PHONY: check-codestyle
check-codestyle:
poetry run ruff check --exit-non-zero-on-fix $(filter-out $@,$(MAKECMDGOALS))
.PHONY: mypy
mypy:
poetry run mypy --config-file pyproject.toml $(filter-out $@,$(MAKECMDGOALS))
.PHONY: check-safety
check-safety:
poetry check
poetry run safety --disable-telemetry check --full-report --disable-audit-and-monitor
.PHONY: lint
lint:
@$(MAKE) -s check-codestyle $(filter-out $@,$(MAKECMDGOALS))
@$(MAKE) -s mypy $(filter-out $@,$(MAKECMDGOALS))
@$(MAKE) -s check-safety
#* Cleaning
.PHONY: clean
clean:
find . | grep -E '(.DS_Store|.mypy_cache|__pycache__|\.hypothesis|htmlcov|\.pytest_cache|\.coverage|\.perm|\.cache|\.static|\.py[cod]$$)' | xargs rm -rf