-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (47 loc) · 2.08 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
.DEFAULT_GOAL := help
.PHONY: check
check: ## Check code formatting and import sorting
python3 -m black --check .
python3 -m ruff check .
.PHONY: fix
fix: ## Fix code formatting, linting and sorting imports
python3 -m black .
python3 -m ruff --fix .
.PHONY: local
local: pip_update ## Install local requirements and dependencies
python3 -m piptools sync requirements/local.txt
.PHONY: outdated
outdated: ## Check outdated requirements and dependencies
python3 -m pip list --outdated
.PHONY: pip
pip: pip_update ## Compile requirements
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/common.txt requirements/common.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/local.txt requirements/local.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/test.txt requirements/test.in
.PHONY: pip_update
pip_update: ## Update requirements and dependencies
python3 -m pip install --quiet --upgrade pip~=23.3.0 pip-tools~=7.3.0 setuptools~=69.0.0 wheel~=0.42.0
.PHONY: precommit
precommit: ## Fix code formatting, linting and sorting imports
python3 -m pre_commit run --all-files
.PHONY: precommit_update
precommit_update: ## Update pre_commit
python3 -m pre_commit autoupdate
ifeq (simpletest,$(firstword $(MAKECMDGOALS)))
simpletestargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
$(eval $(simpletestargs):;@true)
endif
.PHONY: simpletest
simpletest: ## Run debug tests
python3 -m unittest $(simpletestargs)
.PHONY: test
test: ## Run full test and coverage
python3 -m coverage run -m unittest
python3 -m coverage html
python3 -m coverage report
.PHONY: update
update: pip precommit_update ## Run update
.PHONY: help
help:
@echo "[Help] Makefile list commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'