simple example is a standalone bakefile.py: the PEP 723 header at the top declares its own dependencies, so uv creates the environment and nothing else in the directory is required.
What it shows
- Both command patterns in one file:
@command()on class methods,@bakebook.command()on standalone functions (see Commands). - A typed setting (
foo_url) used inside a task (see Settings). - A typed option via
params.FastOption, reused from bakefile’s own options. - Log calls at every level, so
bake -v helloshows verbosity filtering in action (see Logging). - The dev-only
[tool.uv.sources]block pointing at the local repo. A real project would install from PyPI instead (see PEP 723).