-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.53 KB
/
Copy pathMakefile
File metadata and controls
48 lines (36 loc) · 1.53 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
.PHONY: help install install-dev precommit-install format lint test precommit build check clean
UV ?= uv
VENV_BIN ?= .venv/bin
PYTHON ?= $(VENV_BIN)/python
PRECOMMIT ?= $(VENV_BIN)/pre-commit
PYTEST ?= $(VENV_BIN)/pytest
RUFF ?= $(VENV_BIN)/ruff
PYTEST_ARGS ?=
help: ## Show available commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-18s %s\n", $$1, $$2}'
install: ## Create the environment and install mm-evalkit
$(UV) venv --python 3.11
$(UV) pip install --python $(PYTHON) -e .
install-dev: ## Install mm-evalkit with test, lint, and build tools
$(UV) venv --python 3.11
$(UV) pip install --python $(PYTHON) -e '.[dev]'
precommit-install: ## Install the Git pre-commit hook
$(PRECOMMIT) install
format: ## Format and import-sort every Python file
$(RUFF) format .
$(RUFF) check --fix --select I .
lint: ## Check formatting and strict Ruff rules
$(RUFF) format --check .
$(RUFF) check .
test: ## Run the test suite; pass extra options with PYTEST_ARGS
$(PYTEST) -q $(PYTEST_ARGS)
precommit: ## Run every pre-commit hook against every tracked file
$(PRECOMMIT) run --all-files
build: ## Build source and wheel distributions
$(PYTHON) -m build
check: lint test precommit ## Run all release checks
clean: ## Remove local build and Python cache artifacts
rm -rf build dist .pytest_cache .ruff_cache
find src -maxdepth 1 -type d -name '*.egg-info' -prune -exec rm -rf {} +
find . -type d -name __pycache__ -prune -exec rm -rf {} +
find . -type f -name '*.py[co]' -delete