Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
66 lines (55 loc) · 2.04 KB
/
Copy pathjustfile
File metadata and controls
66 lines (55 loc) · 2.04 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
# List available targets.
default:
just --list
# Generate documentation, by default under `./doc/html`.
doc docdir='doc/html': install-kernel
rm -rf {{docdir}}
mkdir -p {{docdir}}
uv run --group doc pdoc \
--output-directory {{docdir}} \
--no-include-undocumented \
--docformat numpy \
--search \
transformnd
mkdir -p {{docdir}}/examples
uv run --group doc jupytext --to ipynb examples/*.py
uv run --group doc jupyter dejavu --to html examples/*.ipynb --output-dir {{docdir}}/examples
# Install a jupyter kernel required by examples
install-kernel:
uv run --group doc python -m ipykernel install --name python_kernel --user
# Run examples.
examples-run: install-kernel
uv run --group examples jupytext --execute examples/*.py
# Run linters and type checkers.
lint:
uv run --group lint ruff check src tests examples bench
uv run --group lint mypy src tests bench
uv run --group lint ruff format --check src tests examples bench
uv run --group lint pydoclint src
# Auto-fix format and lints where possible.
fix:
uv run --group lint ruff check --fix src tests examples bench
uv run --group lint ruff format src tests examples bench
# Format python code.
format:
uv run --group lint ruff format src tests examples bench
# Run unit tests.
test:
uv run --group test --all-extras pytest -v
# Run benchmarks.
bench:
uv run --group test --all-extras pytest -v --benchmark-only
# Bump version, creating a git tag and changelog entry. Level can be "major", "minor", or "patch".
bump level:
test -z "$(git status --porcelain)" || ( git status && false )
uv version --bump {{level}}
changelog release "$(uv version --short)"
git add .
git commit -m "Bump to v$(uv version --short)"
git tag -a "v$(uv version --short)" -m "$(changelog entry latest)"
# Run pre-commit hooks on all files.
pre-commit:
uv run --group dev prek run --all-files
# Run a REPL with all dependencies installed.
repl:
uv run --all-groups --all-extras --with ipython ipython