-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
82 lines (64 loc) · 1.7 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
79
80
81
82
.DEFAULT_GOAL := help
CODE = termynal tests
RUNNER = uv run
TEST = $(RUNNER) pytest $(args)
.PHONY: help
help: ## Show help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all
all: format lint test ## Run format lint test
.PHONY: install-uv
install-uv: ## Install uv
pip install uv
.PHONY: install
install: ## Install dependencies
uv sync --all-extras
.PHONY: install-docs
install-docs: ## Install docs dependencies
uv sync --group docs
.PHONY: install-git
install-git: ## Install git dependencies
uv sync --group git
.PHONY: build
build: ## Build package
@uv build
.PHONY: publish
publish: build ## Publish package
@uv publish --username=$(pypi_username) --password=$(pypi_password)
.PHONY: test
test: ## Test with coverage
$(TEST) --cov=./
.PHONY: test-fast
test-fast: ## Test until error
$(TEST) --exitfirst
.PHONY: test-failed
test-failed: ## Test failed
$(TEST) --last-failed
.PHONY: test-report
test-report: ## Report testing
$(TEST) --cov --cov-report html
$(RUNNER) python -m webbrowser 'htmlcov/index.html'
.PHONY: lint
lint: ## Check code
$(RUNNER) ruff $(CODE)
$(RUNNER) black --check $(CODE)
$(RUNNER) pytest --dead-fixtures --dup-fixtures
$(RUNNER) mypy $(CODE)
.PHONY: format
format: ## Formating code
$(RUNNER) ruff --fix-only $(CODE)
$(RUNNER) black $(CODE)
.PHONY: docs
docs: ## Build docs
$(RUNNER) mkdocs build -s -v
.PHONY: docs-serve
docs-serve: ## Serve docs
$(RUNNER) mkdocs serve
.PHONY: bump
bump: ## Bump version (commit and tag)
$(RUNNER) cz bump --major-version-zero
.PHONY: clean
clean: ## Clean
rm -rf site || true
rm -rf dist || true
rm -rf htmlcov || true