-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (68 loc) · 2.96 KB
/
Copy pathMakefile
File metadata and controls
98 lines (68 loc) · 2.96 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
91
92
93
94
95
96
97
98
.DEFAULT_GOAL := help
.PHONY: develop requirements build install lint-py lint-docs lint lints fix-py fix-docs fix format check-dist check-types checks check test tests coverage show-version patch minor major dist dist-build dist-py-wheel dist-py-sdist dist-check test-dist publish deep-clean clean help
develop: ## install dependencies and build library
uv pip install -e '.[develop]'
requirements: ## install prerequisite Python build requirements
uv pip install -r pyproject.toml --extra develop
build: ## build the Python library
python -m build -n
install: ## install library
uv pip install .
lint-py: ## lint Python with ruff
python -m ruff check python_template_cython .github/scripts
python -m ruff format --check python_template_cython .github/scripts
lint-docs: ## lint documentation
python -m mdformat --check README.md docs/development.md
python -m codespell_lib README.md docs/development.md
fix-py: ## autoformat Python code
python -m ruff check --fix python_template_cython .github/scripts
python -m ruff format python_template_cython .github/scripts
fix-docs: ## autoformat documentation
python -m mdformat README.md docs/development.md
python -m codespell_lib --write README.md docs/development.md
lint: lint-py lint-docs ## run all linters
lints: lint
fix: fix-py fix-docs ## run all autoformatters
format: fix
check-dist: ## check sdist and wheel contents
check-dist -v --rebuild
check-types: ## check Python types (advisory)
ty check python_template_cython
checks: check-dist ## run distribution checks
check: checks
test: ## run Python tests
python -m pytest python_template_cython/tests
tests: test
coverage: ## run tests with coverage
python -m pytest python_template_cython/tests --cov=python_template_cython --cov-report term-missing --cov-report xml
show-version: ## show current library version
@bump-my-version show current_version
patch: ## bump a patch version
@bump-my-version bump patch
minor: ## bump a minor version
@bump-my-version bump minor
major: ## bump a major version
@bump-my-version bump major
dist-build: ## build local Python distributions
python -m build -w -s
dist-py-wheel: dist-py-sdist ## build portable native wheels from the sdist
python -m cibuildwheel --output-dir dist dist/*.tar.gz
dist-py-sdist: ## build a source distribution
python -m build --sdist --outdir dist
dist-check: ## check distribution metadata
python -m twine check dist/*
test-dist: ## test installed wheels and rebuild source distributions
python .github/scripts/test-distributions.py
dist: ## build and check local distributions
$(MAKE) clean
$(MAKE) dist-build
$(MAKE) dist-check
publish: dist
deep-clean: ## clean everything from the repository
git clean -fdx
clean: ## remove distribution build output
rm -rf build dist python_template_cython.egg-info
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
print-%:
@echo '$*=$($*)'