-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 2.09 KB
/
Copy pathMakefile
File metadata and controls
68 lines (54 loc) · 2.09 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
.PHONY: help install install-docs setup-hooks test lint format type-check clean build docs docs-linkcheck check
# Sphinx documentation variables
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = docs/sphinx
BUILDDIR = docs/sphinx/_build
help:
@echo "Available commands:"
@echo " install Install package and dev dependencies with uv"
@echo " install-docs Install documentation dependencies with uv"
@echo " setup-hooks Configure git to use .githooks directory"
@echo " test Run tests with coverage"
@echo " lint Run linter (ruff check)"
@echo " format Format code (ruff format)"
@echo " type-check Run type checker (ty)"
@echo " check Run all checks (lint, format --check, type-check)"
@echo " docs Build documentation"
@echo " docs-linkcheck Check documentation for broken links"
@echo " clean Remove all build and documentation artifacts"
@echo " build Build distribution packages"
install:
uv sync --extra dev
install-docs:
uv sync --extra docs
setup-hooks:
git config core.hooksPath .githooks
@echo "Git hooks configured! Hooks in .githooks/ will now run automatically."
test:
uv run pytest
lint:
uv run ruff check persian tests
format:
uv run ruff format persian tests
uv run ruff check --fix persian tests
type-check:
uv run ty check persian
check: lint type-check
uv run ruff format --check persian tests
clean:
rm -rf build dist *.egg-info
rm -rf .pytest_cache .ruff_cache .coverage htmlcov coverage.xml
rm -rf $(BUILDDIR)
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type f -name ".DS_Store" -delete 2>/dev/null || true
build: clean
uv build
docs:
@echo "Building documentation..."
@uv run $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
@echo "Documentation built! Open docs/sphinx/_build/html/index.html"
docs-linkcheck:
@echo "Checking documentation for broken links..."
@uv run $(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)