-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
81 lines (61 loc) · 1.96 KB
/
justfile
File metadata and controls
81 lines (61 loc) · 1.96 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
# Render Engine API - Just recipes
# Run tasks with: just <task-name>
DEFAULT_PYTHON_VERSION := "3.14"
# Default recipe to display available commands
default:
@just --list
# Sync dependencies using uv
sync:
uv sync --dev
# Run pytest
test *FLAGS='':
pytest {{ DEFAULT_PYTHON_VERSION }} {{ FLAGS }}
# Install pre-commit hooks
pre-commit-install:
uvx pre-commit install
# Run pre-commit on all files
pre-commit:
uvx pre-commit run --all-files
# Run pre-commit on staged files (default git behavior)
pre-commit-run:
uvx pre-commit run
# Update pre-commit hook versions
pre-commit-update:
uvx pre-commit autoupdate
# Run tests in arbitrary Python version.
pytest VERSION *FLAGS='':
uv run -p {{ VERSION }} --dev pytest {{ FLAGS }}
# Run pytest with coverage report (defaults to XML)
test-cov-report REPORT='xml':
uv run --dev pytest --cov-report={{ REPORT }}
# Run all nox sessions
nox:
uvx nox
# Run ruff linter without fixing
lint DIRECTORY='.':
uvx ruff check {{ DIRECTORY }}
# Run ruff linter with auto-fix
lint-fix DIRECTORY='.':
uvx ruff check --fix {{ DIRECTORY }}
# Run ruff formatter as check
format DIRECTORY='.':
uvx ruff format --check {{ DIRECTORY }}
# Run ruff formatter and fix issues
format-fix DIRECTORY='.':
uvx ruff format --check {{ DIRECTORY }}
ruff: lint format
# Run both linter and formatter, fixing issues.
ruff-fix DIRECTORY='.':
@# Prefacing with `-` to ignore any errors that might be fixed by formatting.
-uvx ruff check --fix {{ DIRECTORY }}
uvx ruff format {{ DIRECTORY }}
uvx ruff check {{ DIRECTORY }}
@echo "\nEverything looks good!"
# Run ty type checker
ty PATH='src':
uv run ty check {{ PATH }} # For the moment we have way too many issues in ty so not having it fail.
# Generate coverage badge
badge: (test-cov-report 'xml')
uvx --with "genbadge[coverage]" genbadge coverage -i coverage.xml
# Run full CI workflow (sync, lint, test, badge)
ci: sync nox ruff ty badge