forked from DCC-BS/docling-glm-ocr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (40 loc) · 1.77 KB
/
Copy pathMakefile
File metadata and controls
56 lines (40 loc) · 1.77 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
.DEFAULT_GOAL := help
.PHONY: help install check lint format type-check test test-xml build clean-build publish
help: ## Display available commands
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} \
/^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
# ---------------------------------------------------------------------------
# Setup
# ---------------------------------------------------------------------------
install: ## Install dependencies and pre-commit hooks
uv sync --all-extras --dev
uv run pre-commit install
# ---------------------------------------------------------------------------
# Quality checks
# ---------------------------------------------------------------------------
lint: ## Run ruff linter (with auto-fix)
uv run ruff check . --fix
format: ## Run ruff formatter
uv run ruff format .
type-check: ## Run ty type checker
uv run ty check src/
check: ## Run all quality checks (lint, format check, type check)
uv run ruff check .
uv run ruff format --check .
uv run ty check src/
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
test: ## Run tests with terminal coverage report
uv run pytest
test-xml: ## Run tests and produce XML coverage report only
uv run pytest --cov-report=xml --cov-report=
# ---------------------------------------------------------------------------
# Build & publish
# ---------------------------------------------------------------------------
build: clean-build ## Build distribution packages
uv build
clean-build: ## Remove build artefacts
rm -rf dist/ build/ *.egg-info
publish: build ## Publish package to PyPI
uv publish