Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (73 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
90 lines (73 loc) · 2.24 KB
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
83
84
85
86
87
88
89
90
.PHONY: help
SOURCE?=notifykit
TESTS?=tests
help:
@echo "============="
@echo "notifykit 👀"
@echo "============="
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
tools: ## Install development tools
@echo "Installing development tools..."
@uv tool install maturin
lib-lint: ## Lint the library codebase without changes (Rust)
@cargo fmt --version
@cargo fmt --all -- --check
@cargo clippy --version
@cargo clippy -- -D warnings
lib-lint-fix: ## Lint the library codebase (Rust)
@cargo fmt --version
@cargo fmt --all
@cargo clippy --version
@cargo clippy -- -D warnings
build: ## Build the library
@uv build
build-linux: ## Build the library for Linux (x86_64, abi3 wheel)
@docker run --rm \
-v "$(PWD)":/io \
ghcr.io/pyo3/maturin:latest \
build --release --out dist
lib-dev: tools ## Build the library codebase as importable .so module
@uvx maturin develop
lib-release: ## Build an optimized version of the .so module
@uvx maturin build -r
test: ## Run all tests
@uv run pytest $(TESTS)
test-v: ## Run all tests (verbose)
@uv run pytest $(TESTS) -v
test-linux: ## Run tests in a Linux Docker container
@docker build -t notifykit-test -f Dockerfile.test .
@docker run --rm notifykit-test
lint: ## Lint all Python source code without changes
@uv lock
@uv run ruff check $(SOURCE)
@uv run ruff format $(SOURCE) --diff
@uv run mypy --pretty $(SOURCE)
lint-fix: ## Lint all source code
@uv run ruff check --fix $(SOURCE)
@uv run ruff format $(SOURCE)
@uv run mypy --pretty $(SOURCE)
docs-serve: ## Run documentation locally
@pdm run mkdocs serve -a localhost:7756
docs-build: ## Make a publishable version of documentation
@pdm run mkdocs build
.PHONY: clean
clean: # Clean all cache dirs
@rm -rf `find . -name __pycache__`
@rm -f `find . -type f -name '*.py[co]' `
@rm -f `find . -type f -name '*.so' `
@rm -f `find . -type f -name '*~' `
@rm -f `find . -type f -name '.*~' `
@rm -f tests/__init__.py
@rm -rf .cache
@rm -rf htmlcov
@rm -rf .pytest_cache
@rm -rf .mypy_cache
@rm -rf *.egg-info
@rm -f .coverage
@rm -f .coverage.*
@rm -rf build
@rm -rf dist
@rm -rf sdist
@rm -rf site
@rm -rf .ruff_cache
@rm -rf target