TIL: Dependency groups and uv run
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Python developers can now clone a project and run its tests with a single 'uv run pytest' command, removing manual virtualenv and dependency setup steps.
Simon Willison published a short guide (a 'TIL' post) explaining a trick for Python projects using uv, a tool that manages Python packages. By declaring a 'dev' dependency group containing pytest in pyproject.toml, anyone who clones a project can run 'uv run pytest' and the test tool installs and runs automatically. He demonstrated it on his datasette-extract project, and also used Claude Code to build a redirects plugin for his TIL site.
Willison documents a project setup pattern using uv and PEP 735 dependency groups that cuts onboarding to three commands: clone, cd, and 'uv run pytest'. This reduces friction for contributors to his open-source projects like datasette-extract. He also shipped a small plugin, datasette-redirects, built with Claude Code, to handle URL redirects after reorganising his TIL site. The cost is minimal; the benefit is faster developer onboarding.
The pattern declares a dev dependency group under PEP 735 in pyproject.toml, [dependency-groups] dev = ["pytest"], so 'uv run pytest' auto-creates a virtual environment, installs the group, and executes tests. No manual 'uv sync' or activation is needed. Willison also reorganised his uv TILs into a subfolder, requiring a datasette-redirects plugin for old-path redirects and a build-script change to preserve file creation dates.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
uv pytest PEP 735 pyproject.toml datasette-extract datasette-redirects Claude Code
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.