Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
90 lines (68 loc) · 2.14 KB
/
Copy pathJustfile
File metadata and controls
90 lines (68 loc) · 2.14 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
IMAGE := "my-python-application:latest"
DOCKERFILE := ".docker/python/Dockerfile"
# Show all available recipes
default:
@just --list
# Install all dependencies from the lockfile
sync:
uv sync
# Install dependencies and register the pre-commit hooks
install: sync
uv run pre-commit install
# Run the CLI, e.g. `just run user list`
run *ARGUMENTS:
uv run core {{ ARGUMENTS }}
# Run the test suite, e.g. `just test -k users`
test *ARGUMENTS:
uv run pytest {{ ARGUMENTS }}
# Run the test suite with a coverage report
test-coverage:
uv run pytest --cov=src
# Lint with ruff
lint:
uv run ruff check .
# Lint with ruff and apply the safe fixes
lint-fix:
uv run ruff check . --fix
# Format with ruff
format:
uv run ruff format .
# Report formatting problems without rewriting files
format-check:
uv run ruff format . --check
# Static type analysis with ty
type-check:
uv run ty check
# Security scan only (bandit rules, already part of `just lint`)
security:
uv run ruff check . --select S
# Run every pre-commit hook against all files
hooks:
uv run pre-commit run --all-files
# Full read-only quality gate: lint (incl. security), formatting, types, tests
check: lint format-check type-check test
# Reformat and autofix, then run the full quality gate
fix: format lint-fix check
# Build the Docker image
docker-build:
docker buildx build -f {{ DOCKERFILE }} -t {{ IMAGE }} .
# Run the CLI inside the Docker image, e.g. `just docker-run user list`
docker-run *ARGUMENTS:
docker run -it --rm {{ IMAGE }} core {{ ARGUMENTS }}
# Refresh the lockfile without changing pinned versions
lock:
uv lock
# Upgrade every dependency to the newest version the constraints allow
upgrade:
uv lock --upgrade
uv sync
# List dependencies that have a newer release available
outdated:
uv tree --outdated --depth 1
# Bump the pre-commit hooks to their latest revisions
hooks-update:
uv run pre-commit autoupdate
# Delete caches, build artifacts and coverage data
clean:
rm -rf .cache .ruff_cache .mypy_cache .coverage htmlcov dist build
find . -path ./.venv -prune -o -type d -name __pycache__ -exec rm -rf {} +