Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (101 loc) · 3.61 KB
/
Copy pathMakefile
File metadata and controls
102 lines (101 loc) · 3.61 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.ONESHELL:
SHELL := bash
.DEFAULT_GOAL := help
.PHONY: help env env-req env-sug env-dev env-doc env-all env-clean env-lock\
pre-commit-install pre-commit-run \
check format lint typecheck test test-coverage test-ci \
docs-init docs-build docs-preview \
build \
clean-build clean-pyc clean-checks clean
help:
@printf "\nseapig Makefile — common targets:\n\n"
@printf " %-22s %s\n" env "Create + enter virtualenv (uses uv)"
@printf " %-22s %s\n" env-req "Install the package into the environment"
@printf " %-22s %s\n" env-sug "Install the package with suggested dependencies"
@printf " %-22s %s\n" env-dev "Install the package with development dependencies"
@printf " %-22s %s\n" env-doc "Install docs deps and register quarto plugin"
@printf " %-22s %s\n" env-all "Install all extras"
@printf " %-22s %s\n" env-clean "Remove the virtual environment (.venv)"
@printf " %-22s %s\n" env-lock "Update lock file (uv.lock)"
@printf " %-22s %s\n" pre-commit-install "Install all pre-commit hooks"
@printf " %-22s %s\n" pre-commit-run "Run configured pre-commit hooks on all files"
@printf " %-22s %s\n" check "Run format, lint, typecheck and tests"
@printf " %-22s %s\n" format "Format code (ruff format)"
@printf " %-22s %s\n" lint "Run linters (ruff)"
@printf " %-22s %s\n" typecheck "Run ty type checks"
@printf " %-22s %s\n" test "Run tests (pytest)"
@printf " %-22s %s\n" test-coverage "Run tests with coverage"
@printf " %-22s %s\n" test-ci "Run tests in CI mode (fast fail)"
@printf " %-22s %s\n" docs-init "Initialize great-docs config and structure"
@printf " %-22s %s\n" docs-build "Scan and build docs with great-docs"
@printf " %-22s %s\n" docs-preview "Preview docs locally with great-docs"
@printf " %-22s %s\n" build "Build the package (python -m build)"
@printf " %-22s %s\n" clean "Remove all build, Python, and test artifacts"
@printf " %-22s %s\n" clean-build "Remove build artifacts"
@printf " %-22s %s\n" clean-pyc "Remove Python file artifacts"
@printf " %-22s %s\n" clean-checks "Remove test/check artifacts"
@printf "\nRun \`make <target>\` to execute a target. See Makefile for details.\n\n"
env:
uv venv; source .venv/bin/activate;
update:
uv sync --all-extras
env-req:
source .venv/bin/activate; uv sync; uv pip install -e .
env-sug:
source .venv/bin/activate; uv sync --extra suggested; uv pip install -e .
env-dev:
source .venv/bin/activate; uv sync --extra dev; uv pip install -e .
env-doc:
source .venv/bin/activate; uv sync --extra docs; uv pip install -e .
env-all:
source .venv/bin/activate; uv sync --extra all; uv pip install -e .
env-clean:
rm -rf .venv
env-lock:
uv lock
format:
ruff format .
lint:
ruff check .
typecheck:
ty check .
test:
pytest -q
test-coverage:
pytest --cov --cov-report=term-missing
test-ci:
pytest --maxfail=1 -q
# pre-commit helpers
pre-commit-install:
pre-commit install --hook-type pre-commit --hook-type commit-msg --install-hooks
pre-commit-run:
pre-commit run --all-files
# check pipeline (deterministic)
check: format lint typecheck test-coverage
# documentation
docs-init:
great-docs init
docs-build:
great-docs build
docs-preview:
great-docs preview
build: clean
python -m build
clean-build:
rm -rf build/
rm -rf dist/
rm -rf .eggs/
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.egg' -exec rm -rf {} +
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
clean-checks:
rm -f .coverage
rm -rf .tox/
rm -rf .pytest_cache
rm -rf .mypy_cache/
rm -rf .ruff_cache/
clean: clean-build clean-pyc clean-checks