-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
53 lines (39 loc) · 1.21 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
##@ Utility
.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: venv
uv: ## Install uv
@command -v uv >/dev/null 2>&1 || curl -LsSf https://astral.sh/uv/install.sh | sh
.PHONY: dev
dev: uv ## Install dev dependencies
uv sync --dev
.PHONY: install
install: uv ## Install dependencies
uv sync
.PHONY: test
test: ## Run tests
uv run pytest
.PHONY: lint
lint: ## Run linters
uv run ruff check ./src ./tests
.PHONY: fix
fix: ## Fix lint errors
uv run ruff check ./src ./tests --fix
.PHONY: cov
cov: ## Run tests with coverage
uv run pytest --cov=src --cov-report=term-missing
.PHONY: pages
pages: doc ## Build documentation and push to gh-pages
mkdir gh-pages
touch gh-pages/.nojekyll
cp -r docs/build/html/* gh-pages/
.PHONY: doc
doc: ## Build documentation
cd docs && uv run make html
.PHONY: build
build: ## Build package
uv build
.PHONY: dbash
dbash: ## Run docker
docker run -v ${PWD}:/git/$(shell basename ${PWD}) -w /git/$(shell basename ${PWD}) -it python:3.12 /bin/bash