-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathjustfile
More file actions
62 lines (53 loc) · 1.95 KB
/
justfile
File metadata and controls
62 lines (53 loc) · 1.95 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
# List all the justfile recipes
list:
just -l
# Generate Sphinx HTML documentation, including API docs
docs:
uv run --python=3.13 --isolated --group docs -- sphinx-build docs docs/_build
open docs/_build/index.html
# Host the docs locally and rebuild on changes
servedocs:
uv run --python=3.13 --isolated --group docs -- \
sphinx-autobuild -Wa docs/ docs/_build/html --open-browser --port 9812 \
--watch cookiecutter
# lint with ruff
lint:
uv run --python=3.13 --isolated --group lint -- ruff check . --fix
# lint check with ruff
lint-check:
uv run --python=3.13 --isolated --group lint -- ruff check --no-fix .
# Run all the tests for all the supported Python versions
test-all:
uv run --python=3.10 --isolated --group test -- pytest
uv run --python=3.11 --isolated --group test -- pytest
uv run --python=3.12 --isolated --group test -- pytest
uv run --python=3.13 --isolated --group test -- pytest
uv run --python=3.14 --isolated --group test -- pytest
VERSION := `grep -m1 '^version' pyproject.toml | sed -E 's/version = "(.*)"/\1/'`
# Print the current version of the project
version:
@echo "Current version is {{VERSION}}"
# Tag the current version and push to GitHub
tag:
#!/usr/bin/env bash
set -euo pipefail
if [ "$(git branch --show-current)" != "main" ]; then
echo "Error: not on main branch" >&2
exit 1
fi
if [ -n "$(git status --porcelain)" ]; then
echo "Error: working tree is not clean" >&2
exit 1
fi
if [ ! -f "CHANGELOG/{{VERSION}}.md" ]; then
echo "Error: CHANGELOG/{{VERSION}}.md not found" >&2
exit 1
fi
echo "Tagging v{{VERSION}}"
git tag -a v{{VERSION}} -m "Release {{VERSION}}"
git push origin main
git push origin v{{VERSION}}
# Run all tests with coverage
coverage:
uv run --python=3.13 --isolated --group test -- \
pytest --cov-report=html --cov-report=xml --cov-branch --cov-fail-under=100