-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.72 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.72 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
PACKAGE ?= whistle
UV ?= $(shell which uv || echo uv)
UVX ?= $(shell which uvx || echo uvx)
VERSION ?= $(shell git describe 2>/dev/null || git rev-parse --short HEAD)
PYTEST_OPTIONS ?= --capture=no --cov=$(PACKAGE) --cov-report html
SPHINX_BUILD ?= sphinx-build
SPHINX_OPTIONS ?=
SPHINX_SOURCEDIR ?= docs
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
.PHONY: $(SPHINX_SOURCEDIR) clean clean-dist apidoc format help install install-dev release test benchmarks qa
install: ## Installs the project.
$(UV) sync --no-dev
install-dev: ## Installs the project (with dev dependencies).
$(UV) sync --all-groups
wheel:
mkdir -p dist
bin/sandbox "$(MAKE) install-dev; $(UV) build; cp dist/* $(PWD)/dist"
clean: clean-dist ## Cleans up the working copy.
find . -name __pycache__ -type d | xargs rm -rf
clean-dist: ## Cleans up the distribution files (wheels...)
rm -rf build dist *.egg-info
apidoc: ## Generate api doc
rm -rf docs/reference;
$(UV) run bin/generate_apidoc
docs: ## Build html documentation
$(UV) run $(MAKE) -C docs html
docs-dev: ## Spin up a livereload documentation server
$(UV) run $(MAKE) -C docs dev
test: install-dev ## Runs the test suite.
$(UV) run pytest $(PYTEST_OPTIONS) --benchmark-disable tests
benchmarks: install-dev ## Runs the benchmark suite.
$(UV) run pytest $(PYTEST_OPTIONS) --benchmark-only tests
qa: clean apidoc format test benchmarks
format: install-dev ## Reformats the whole python codebase using ruff.
$(UV) run ruff check --fix .
$(UV) run ruff format .
help: ## Shows available commands.
@echo "Available commands:"
@echo
@grep -E '^[a-zA-Z_-]+:.*?##[\s]?.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##"}; {printf " make \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo