Skip to content

Commit 31bcb04

Browse files
jacobo-doistclaude
andcommitted
Chezmoi: Use uv to run Python scripts
Chezmoi does not use the shebang line when executing scripts; it uses its own interpreter configuration instead. Without this, .py scripts are run with bare Python, bypassing the `#!/usr/bin/env -S uv --quiet run --script` shebang and failing to auto-install PEP 723 inline dependencies. Configure chezmoi to run .py scripts via `uv run --script` so that scripts like typos_propagation.py can declare and auto-install their own dependencies (click, pyyaml). Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>
1 parent 4fc4a7b commit 31bcb04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

home/.chezmoi.toml.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
[diff]
55
exclude = ["scripts"]
66

7+
[interpreters.py]
8+
command = "uv"
9+
args = ["--quiet", "run", "--script"]
10+
711
# chezmoi provides a hooks.read-source-state.pre hook that allows you to modify
812
# your system after chezmoi init has cloned your dotfile repo but before chezmoi
913
# has read the source state. This is the perfect time to install your password

0 commit comments

Comments
 (0)