-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (43 loc) · 1.41 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
SOURCE?=src
TESTS?=tests
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Install project dependencies
@pdm install
clean: ## Clean temporary files
@echo "🧹 Cleaning temporary files.."
@rm -rf dist
@rm -rf .mypy_cache .pytest_cache .ruff_cache
@rm -rf .coverage htmlcov coverage.xml
@rm -rf .mutmut-cache
@rm -rf site
lint-check: ## Lint source code without modifying it
@echo "🧹 Ruff"
@pdm run ruff check $(SOURCE) $(TESTS)
@pdm "🧽 MyPy"
@poetry run mypy --pretty $(SOURCE) $(TESTS)
lint: ## Lint source code
@echo "🧹 Ruff"
@pdm run ruff check --fix $(SOURCE) $(TESTS)
@echo "🧽 MyPy"
@pdm run mypy --pretty $(SOURCE) $(TESTS)
docs-run: ## Start docs with autoreload
@pdm run mkdocs serve
build-docs: ## Build docs
@pdm run mkdocs build
build: build-docs ## Build the project
@echo "🏗️ Building the project.."
@pdm build
publish: ## Publish the project
@echo "🚀 Publishing the project.."
@pdm publish
test: ## Run tests
@pdm run coverage run -m pytest $(TESTS) $(SOURCE)
test-cov-html: ## Generate test coverage
@pdm run coverage report --show-missing
@pdm run coverage html
test-cov-xml: ## Run tests
@pdm run coverage run -m pytest $(TESTS) --cov $(SOURCE) --cov-report=xml
test-cov-open: test-cov-html ## Open test coverage in browser
@open htmlcov/index.html