-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
111 lines (90 loc) · 4.44 KB
/
Copy pathjustfile
File metadata and controls
111 lines (90 loc) · 4.44 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
103
104
105
106
107
108
109
110
111
# Dev task runner for processkit — one canonical command per dev-cycle step.
#
# Why `just` and not `nox`/`poe`: several of these steps aren't Python at all
# (cargo, mdbook, a PowerShell script for the Windows Rust-test workaround), so
# a Python-task runner would need a Python interpreter bootstrapped just to shell
# out to non-Python tools. `just` is a single cross-platform binary with no
# Python-environment dependency, so it works identically before and after
# `uv run maturin develop` and regardless of which interpreter is active.
#
# Install: https://github.com/casey/just#installation (or `cargo install just`,
# `uv tool install rust-just`, `winget install --id Casey.Just`, `brew install just`).
#
# Every recipe below only wraps an existing canonical command (see
# CONTRIBUTING.md and .github/workflows/ci.yml) — it introduces no new
# formatting/testing/build logic of its own.
# `just` otherwise looks for `sh` even on Windows, where this repository's
# documented shell and helper scripts use PowerShell 7.
set windows-shell := ["pwsh", "-NoLogo", "-Command"]
# List available recipes (default when `just` is run with no arguments).
default:
just --list
# Build the Rust extension and install it in-place (required before test/rust-test).
build:
uv run maturin develop
# Run the Python test suite (requires `just build` first).
test:
uv run pytest
# Run the serial memory/reference stability suite used by nightly hardening.
leak-test:
uv run pytest tests/test_memory_leaks.py -p no:xdist -o addopts="-ra --strict-markers --strict-config --import-mode=importlib"
# Apply ruff formatting.
fmt:
uv run ruff format .
# Check formatting and lint (the read-only gate CI enforces; use `just fmt` to fix).
lint:
uv run ruff format --check .
uv run ruff check .
# Type-check: mypy --strict, then stubtest the compiled extension against the stub.
typecheck:
uv run mypy
uv run python -m mypy.stubtest processkit --ignore-disjoint-bases --allowlist stubtest-allowlist.txt
# The three recipes below share one note. On Windows .cargo/config.toml routes
# every test binary through scripts/cargo-runner-windows.ps1, which puts the base
# Python DLL on PATH, so `just rust-test` needs no PATH juggling there either —
# prefer it. `rust-test-windows` stays a supported alias that additionally pins
# PYO3_PYTHON, so the BUILD ignores whatever python comes first on PATH; note
# that alternating the two recompiles pyo3 every time (CONTRIBUTING.md explains
# why). `rust-test-no-system-python` is the guard that keeps the first one
# honest. All three are described under "Rust tests on Windows" there.
#
# `just` uses the single comment line directly above a recipe as its `--list`
# description (that is why this block is set off by a blank line).
# Rust unit tests (every platform, Windows included).
rust-test:
cargo test --all-targets
# Rust unit tests on Windows, with the build interpreter pinned to uv's.
rust-test-windows:
pwsh ./scripts/cargo-test-windows.ps1
# Rust unit tests on Windows with no system Python on PATH (CI's regression guard).
rust-test-no-system-python:
pwsh ./scripts/rust-test-no-system-python.ps1
# Build the mdBook documentation site and validate rendered local links/anchors.
docs:
mdbook build
uv run python scripts/check_docs_links.py book
# Regenerate docs/api-reference.md from the type stub.
api-ref:
uv run python scripts/gen_api_reference.py
# Verify docs/api-reference.md is up to date without rewriting it (CI-style check).
api-ref-check:
uv run python scripts/gen_api_reference.py --check
# Regenerate docs/llms.txt and docs/llms-full.txt from the docs guides.
llms:
uv run python scripts/gen_llms_txt.py
# Verify docs/llms.txt and docs/llms-full.txt are up to date without rewriting them (CI-style check).
llms-check:
uv run python scripts/gen_llms_txt.py --check
# Regenerate docs/changelog.md from the root CHANGELOG.md.
changelog:
uv run python scripts/gen_changelog_page.py
# Verify the committed release-notes page is current.
changelog-check:
uv run python scripts/gen_changelog_page.py --check
# Run the benchmark suite (benchmarks/, pytest-benchmark; separate from `just test`).
bench:
uv sync --group bench
uv run pytest benchmarks/ --benchmark-only -p no:xdist -o addopts=""
# Run the test suite in the Linux Docker container (covers cgroup/process-group teardown, async cancellation, and Ctrl+C paths skipped on Windows).
docker-test:
docker compose run --build --rm test