-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (56 loc) · 1.22 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
.DEFAULT_TARGET: help
sources = src tests
.PHONY: prepare
prepare:
poetry install --with ops
.PHONY: lintable
lintable: prepare
poetry run black $(sources)
poetry run ruff --fix $(sources)
.PHONY: lint
lint: prepare
poetry check
poetry run black --check --diff $(sources)
poetry run ruff check $(sources)
poetry run mypy $(sources)
.PHONY: test
test: prepare
poetry run coverage run -m pytest
poetry run coverage report
.PHONY: test-python-versions
test-python-versions:
poetry env use python3.8
make test
poetry env use python3.9
make test
poetry env use python3.10
make test
poetry env use python3.11
make test
poetry env use python3.12
make test
.PHONY: clean
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]'`
rm -f `find . -type f -name '*~'`
rm -f `find . -type f -name '.*~'`
rm -rf .cache
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf htmlcov
rm -rf *.egg-info
rm -f .coverage
rm -f .coverage.*
rm -rf build
rm -rf dist
rm -rf coverage.xml
.PHONY: package
package: prepare
poetry build
.PHONY: help
help:
@grep -E \
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-19s\033[0m %s\n", $$2, $$3}'