Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
77 lines (56 loc) · 3.01 KB
/
Copy pathjustfile
File metadata and controls
77 lines (56 loc) · 3.01 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
# justfile for python-trueconf-bot
# Environments:
# .venv - production-like install (runtime deps only)
# .venv-tests - test environment (pytest + anyio + trio)
# .venv-docs - mkdocs documentation environment
# Python version for environments (override: just setup python=3.11)
python := env_var_or_default("PYTHON", "3.12")
# ── Environment setup ────────────────────────────────────────────────
# Create all environments
setup: setup-prod setup-test setup-docs
# .venv: install the library as in production (no groups at all)
setup-prod:
UV_PROJECT_ENVIRONMENT=.venv uv sync --no-default-groups --python {{python}}
.venv/bin/python -c "import trueconf; print('prod env OK:', trueconf.__file__)"
# .venv-tests: test environment (project + test group only)
setup-test:
UV_PROJECT_ENVIRONMENT=.venv-tests uv sync --group test --no-default-groups --python {{python}}
.venv-tests/bin/python -c "import trueconf; print('test env OK:', trueconf.__file__)"
# .venv-docs: mkdocs environment (project + docs group only)
setup-docs:
UV_PROJECT_ENVIRONMENT=.venv-docs uv sync --group docs --no-default-groups --python {{python}}
.venv-docs/bin/python -c "import mkdocs; print('docs env OK:', mkdocs.__version__)"
# ── Update ───────────────────────────────────────────────────────────
# Update dependencies in all environments (re-resolve + reinstall, keep envs)
refresh: refresh-prod refresh-test refresh-docs
refresh-prod:
UV_PROJECT_ENVIRONMENT=.venv uv sync --no-default-groups --python {{python}} --refresh --reinstall
refresh-test:
UV_PROJECT_ENVIRONMENT=.venv-tests uv sync --group test --no-default-groups --python {{python}} --refresh --reinstall
refresh-docs:
UV_PROJECT_ENVIRONMENT=.venv-docs uv sync --group docs --no-default-groups --python {{python}} --refresh --reinstall
# ── Clean rebuild with cache purge ───────────────────────────────────
# Remove all environments
clean-envs:
rm -rf .venv .venv-tests .venv-docs
# Purge the uv cache entirely
clean-cache:
uv cache clean --force
# Rebuild everything from scratch: cache + environments + install
clean: clean-envs clean-cache setup
# ── Utilities ────────────────────────────────────────────────────────
# Run the test suite
test:
.venv-tests/bin/python -m pytest tests/ -q
# Build documentation
docs:
DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib" .venv-docs/bin/mkdocs build
# Local documentation server
serve:
DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib" .venv-docs/bin/mkdocs serve
# Lint (ruff via uvx - does not touch environments)
check:
uvx ruff check .
# Update uv.lock
lock:
uv lock --refresh