-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
63 lines (51 loc) · 1.63 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
.PROJECT = boiling_learning
.TESTS_FOLDER = tests
.UNIMPORT = $(shell pdm run unimport --remove --gitignore --ignore-init --include-star-import $(.PROJECT) $(.TESTS_FOLDER))
.BLACK = $(shell pdm run black $(.PROJECT) $(.TESTS_FOLDER))
.ISORT = $(shell pdm run isort $(.PROJECT) $(.TESTS_FOLDER))
.FORMAT = $(foreach command,.UNIMPORT .BLACK .ISORT,$(call $(command)))
.READD = $(shell git update-index --again)
.CHECK = $(shell pre-commit run)
.PHONY: coverage
coverage:
@pdm run coverage run --source=$(.PROJECT)/ -m pytest $(.TESTS_FOLDER)
@pdm run coverage report -m
.PHONY: test
test:
@pdm run pytest --doctest-modules $(.PROJECT) $(.TESTS_FOLDER) -vv
.PHONY: tox
tox:
@pdm run tox
.PHONY: check
check:
@$(call $(.CHECK))
.PHONY: typecheck
typecheck:
@pdm run mypy $(.PROJECT)
.PHONY: format
format:
@$(call $(.FORMAT))
.PHONY: vulture
vulture:
@pdm run vulture --ignore-decorators @*.dispatch*,@*.instance* --ignore-names __*[!_][!_] $(.PROJECT) main.py
.PHONY: autofix
autofix:
@-$(call $(.FORMAT))
@$(call $(.READD))
@-$(call $(.CHECK))
@$(call $(.READD))
.PHONY: release
release:
# for v1.0.0 and after, the following line should be used to bump the project version:
# cz bump
# before v1, use the following command, which maps the following bumps:
# MAJOR -> MINOR (v0.2.3 -> v0.3.0)
# MINOR or PATCH -> PATCH (v0.2.3 -> v0.2.4)
# effectively avoiding incrementing the MAJOR version number while the first
# stable version (v1.0.0) is not released
pdm run cz bump --increment $(shell pdm run cz bump --dry-run | grep -q "MAJOR" && echo "MINOR" || echo "PATCH")
git push
git push --tags
.PHONY: run
run:
pdm run python main.py