-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
115 lines (86 loc) · 2.93 KB
/
Copy pathjustfile
File metadata and controls
115 lines (86 loc) · 2.93 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
112
113
114
115
# pyfgs Project Justfile
# Run `just` to see all available commands
set shell := ["bash", "-uc"]
# Show available commands
default:
@just --list
# Clean build artifacts and cache
clean:
rm -rf site target/wheels
# rm -rf .venv
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".karva_cache" -exec rm -rf {} +
# Install dependencies, compile Rust extension in dev mode, and sync stubs
install: clean
uv sync --all-groups
cargo run --bin stub_gen --no-default-features
uv run python scripts/sync_stubs.py
uvx ruff format python/pyfgs/__init__.py python/pyfgs/__init__.pyi python/pyfgs/_pyfgs/__init__.pyi
# Run the test suite using karva
test +args="": install
uvx --with . --with pytest karva test tests/ {{args}}
# Run tests with coverage using karva
test-cov +args="": install
uvx --with . --with pytest karva test --cov tests/ {{args}}
# Run benchmarks
benchmark: install
uv run --group benches pytest benchmarks/bench_accuracy.py --benchmark-json=benchmark-data.json
# --- Formatting & Linting ---
# Format both Python and Rust code
fmt: fmt-python fmt-rust
# Check Python and Rust formatting
fmt-check: fmt-check-python fmt-check-rust
# Lint both Python and Rust code
lint: lint-python lint-rust
# Format Python code
fmt-python:
uvx ruff format .
# Check Python formatting
fmt-check-python:
uvx ruff format --check .
# Lint Python code
lint-python:
-uvx ruff check .
-uv run ty check .
# Format Rust code
fmt-rust:
cargo fmt
# Check Rust formatting
fmt-check-rust:
cargo fmt --all -- --check
# Lint Rust code
lint-rust:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# --- CI & Build ---
# Run the full CI pipeline locally (format check, lint, test)
ci: install fmt-check lint test-cov
# Build release wheels using maturin
build-wheels:
rm -rf target/wheels
uvx maturin build --release
# Set version in Cargo.toml (useful in CI or releases)
set-version VERSION:
uv run python -c "import re; content = open('Cargo.toml').read(); content = re.sub(r'^version\s*=\s*\".*\"', 'version = \"' + '{{VERSION}}'.lstrip('v') + '\"', content, flags=re.MULTILINE); open('Cargo.toml', 'w').write(content)"
# Generate release notes from GitHub API
generate-releases:
uv run python scripts/generate_release_notes.py
# --- Documentation ---
prep-docs: install
uv run scripts/generate_cli_docs.py
uv run python scripts/generate_api_docs.py
uv run python scripts/fetch_announcement.py
# Build the documentation locally
docs-build: prep-docs
uv run --group docs zensical build -c
# Test if documentation can be built without warnings or errors
docs-test: prep-docs
uv run --group docs zensical build -c -s
serve: prep-docs
uv run --group docs zensical serve
# Build the Python package
build:
uv build
# Publish the Python package to PyPI
publish:
uv publish