-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile
78 lines (68 loc) · 1.75 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
77
78
.PHONY : help
help:
@echo "Usage: make <target>"
@echo " check run pre-commit and tests"
@echo " coverage identify code not covered with tests"
@echo " lint run lint check on module"
@echo " docs run documentation build process"
@echo " help show summary of available commands"
@echo " build build package distribution"
@echo " pre-commit run pre-commit against all files"
@echo " setup setup development environment"
@echo " test run tests (in parallel)"
@echo " tox run tox (in parallel)"
.PHONY : check
check:
make pre-commit
make docs
make test
make build
.PHONY : clean
clean:
find . -name *.mo -delete
find . -name *.pyc -delete
rm -rf .mypy_cache/*
rm -rf .pytest_cache/*
rm -rf .ruff_cache/*
rm -rf dist/*
rm -rf docs/build/*
rm -rf docs/source/_autosummary/*
rm -rf tox/*
rm -rf .coverage
rm -rf .coverage.xml
.PHONY : build
build :
rm -rf *.egg-info/
python3 -m build
.PHONY : coverage
coverage:
pytest --cov=brazilcep --cov-config=pyproject.toml --cov-report term-missing --no-cov-on-fail --cov-report=html
.PHONY : lint
lint:
isort --check brazilcep tests
black --check brazilcep tests
ruff check brazilcep tests
mypy brazilcep
.PHONY : docs
docs:
rm -rf docs/build/
sphinx-autobuild -b html --watch brazilcep/ docs/source/ docs/build/
.PHONY : pre-commit
pre-commit:
pre-commit run --all-files
.PHONY : setup
setup:
pip install -e ".[dev]"
pip install -e ".[coverage]"
pip install -e ".[docs]"
pip install -e ".[build]"
pre-commit install --hook-type pre-commit
pre-commit install --hook-type pre-push
pre-commit autoupdate
mypy --install-types
.PHONY : test
test:
pytest -v
.PHONY : tox
tox:
tox --parallel auto