Justfile now uses uv, docs gets a dependency group

This commit is contained in:
Simon Willison 2026-02-26 20:43:18 -08:00
commit 7a8643f72f
2 changed files with 23 additions and 20 deletions

View file

@ -1,37 +1,29 @@
# Run tests and linters
@default: test lint
# Install dependencies and test dependencies
@init:
pipenv run pip install -e '.[test]'
# Run pytest with supplied options
@test *options:
pipenv run pytest {{options}}
uv run pytest {{options}}
# Run linters
@lint:
echo "Linters..."
echo " Black"
pipenv run black . --check
echo " cog"
pipenv run cog --check README.md docs/*.md
echo " ruff"
pipenv run ruff .
uv run cog --check README.md docs/*.md
echo " ruff check"
uv run ruff check .
echo " ruff format"
uv run ruff format . --check
# Rebuild docs with cog
@cog:
pipenv run cog -r docs/*.md
uv run cog -r docs/*.md
# Serve live docs on localhost:8000
@docs: cog
cd docs && pipenv run make livehtml
cd docs && uv run make livehtml
# Apply Black
@black:
pipenv run black .
# Run automatic fixes
# Apply ruff fixes and formatting
@fix: cog
pipenv run ruff . --fix
pipenv run black .
uv run ruff check . --fix
uv run ruff format .

View file

@ -26,7 +26,7 @@ dclient = "dclient.cli:cli"
client = "dclient.plugin"
[dependency-groups]
dev = [
test = [
"pytest",
"pytest-asyncio",
"pytest-httpx",
@ -34,6 +34,17 @@ dev = [
"pytest-mock",
"datasette>=1.0a25",
]
docs = [
"furo",
"sphinx-autobuild",
"sphinx-copybutton",
"myst-parser",
"cogapp",
]
dev = [
{include-group = "test"},
{include-group = "docs"},
]
[tool.uv.build-backend]
module-root = ""