#+TITLE: * TODO [#A] Add ~uv~ to the install playbook — load-bearing #+SOURCE: from health #+DATE: 2026-05-29 11:27:58 -0500 * TODO [#A] Add ~uv~ to the install playbook — load-bearing for project tooling :install:python: Add ~uv~ (Astral's Python package + script runner) to the archsetup install steps so every future machine setup picks it up automatically. Currently installed on this machine at ~/usr/bin/uv~ (~0.11.15~), but it's not yet part of the standard set — if a fresh install skipped it, project scripts that depend on it would fail silently or break at first run. ** Why this matters now Several projects are moving Python tooling onto ~uv~ with PEP 723 inline script metadata. The pattern is: a script declares its deps in a ~# /// script~ header and shebangs ~#!/usr/bin/env -S uv run --script~, so it self-runs without venvs or pip. First example landed in the health project (~health-drill-to-anki.py~), and the rulesets follow-up recommends promoting that pattern as a template script under ~claude-templates/.ai/scripts/~ — meaning ~uv~ would become a dependency for any project pulling templates. Without ~uv~ in the install playbook, fresh machines would hit ~env: uv: No such file or directory~ on any script using this pattern. The PEP 668 detour (system pip blocked, manual venvs everywhere) was exactly what ~uv~ eliminates. ** Install Arch official: ~pacman -S uv~. If extra/community doesn't carry it, AUR has it as ~uv-bin~ or build-from-source. Astral's official installer is also an option but adds a non-pacman path to maintain. Pacman is cleanest — auto-updates with the rest of the system, lives under ~/usr/bin/uv~. ** Verification (post-install) #+begin_src bash which uv && uv --version #+end_src Should print ~/usr/bin/uv~ and a version string. To verify the PEP 723 pattern works end-to-end: #+begin_src bash cat > /tmp/uv-test.py <<'EOF' #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = ["requests"] # /// import requests print("ok") EOF chmod +x /tmp/uv-test.py && /tmp/uv-test.py #+end_src First run resolves and caches ~requests~; subsequent runs are instant. ** Related - Earlier message in this inbox CANCELLED the ~python-genanki~ install request — that one is no longer needed because ~uv~ + PEP 723 covers it. - The rulesets inbox carries the broader template-script proposal.