-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (58 loc) · 2.47 KB
/
Copy pathMakefile
File metadata and controls
71 lines (58 loc) · 2.47 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
.PHONY: clean setup docs servedocs lint test coverage check release install help
.DEFAULT_GOAL := help
help: ## Help in the makefile
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
clean: ## Remove build artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr .ruff_cache/
rm -fr .mypy_cache/
rm -fr docs/_build/
setup: clean ## Clean, then set up a fresh dev environment (incl. all optional extras)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --dev --all-extras
uv run pre-commit install
check: ## if the first command gives a return, then stage those files, then run pre-commit
git update-index --refresh
uv run pre-commit run --all-files
lint: ## check style with ruff
uv run ruff check .
uv run ruff format --check .
test: ## run tests quickly with the default Python
clear
rm -fr build/
rm -fr dist/
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
uv run python -W ignore -m pytest -v -r=s -r=a -n auto --cov=process_improve
# TODO: single test: ['-p', 'vscode_pytest', '--rootdir=/rootdir', '--capture=no', '/rootdir/tests/test_file.py::test_func']
coverage: ## check code coverage quickly with the default Python
coverage html --precision=1 --skip-covered --skip-empty --title="Process Improve Coverage Report"
coverage report --precision=1 --skip-covered --skip-empty
uv run python -m http.server 8080 --directory htmlcov
docs: ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs clean
$(MAKE) -C docs html
uv run python -m http.server 8080 --directory docs/_build/html/
servedocs: docs ## compile the docs watching for changes
uv run watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
release: ## explain how releases are cut (publishing only happens via the gated workflow)
@echo "Direct publishing from a laptop is disabled (#507)."
@echo "Releases go through the tag-gated workflow .github/workflows/publish.yml:"
@echo " git tag vX.Y.Z && git push origin vX.Y.Z"
@echo "or re-run an already-tagged release via workflow_dispatch on GitHub."
@exit 1
install: ## install the package in dev mode (incl. all optional extras)
uv sync --dev --all-extras