-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
71 lines (53 loc) · 2.37 KB
/
justfile
File metadata and controls
71 lines (53 loc) · 2.37 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
set shell := ["bash", "-uc"]
default: lint test
# ── Formatting / linting ─────────────────────────────────────────────
# Auto-format all Python sources.
format:
uvx ruff format --preview
# Lint-fix all Python sources.
check:
uvx ruff check --preview --fix
# Check formatting + lint without modifying files.
lint:
uvx ruff format --preview --check
uvx ruff check --preview --no-fix
# ── Tests ────────────────────────────────────────────────────────────
# Run the test suite.
test:
uv run pytest
# Run tests with coverage report.
coverage:
uv run --extra test pytest --cov --cov-report=term-missing --cov-fail-under=80
# ── Type checking ────────────────────────────────────────────────────
# Type-check library code (strict mode).
mypy:
uv run --extra dev mypy --strict src
# ── CI aggregate ─────────────────────────────────────────────────────
# Run lint, typecheck, and tests with coverage.
ci: lint mypy coverage
# ── Build & publish ──────────────────────────────────────────────────
# Build sdist + wheel and check with twine.
build-check:
rm -rf dist
uv build
uvx twine check --strict dist/*
# Clean-room install test: fresh venv, install wheel, run tests.
build-test:
#!/usr/bin/env bash
set -euo pipefail
CLEANROOM=$(mktemp -d)
trap 'rm -rf "$CLEANROOM"' EXIT
uv venv "$CLEANROOM/venv"
source "$CLEANROOM/venv/bin/activate"
uv build --wheel --out-dir "$CLEANROOM/dist"
uv pip install --no-cache "$CLEANROOM"/dist/*.whl
uv pip install pytest
python -m pytest tests -q -x
echo "Clean-room test passed."
# Full pre-publish dry run.
build-all: build-check build-test
# ── Utilities ────────────────────────────────────────────────────────
# Remove generated/cached artifacts.
clean:
rm -f uv.lock
rm -rf .venv dist .*_cache