Skip to content

VM setup: install uv and make it the Python convention - #31

Merged
modem7 merged 1 commit into
masterfrom
feature/vm-setup-uv
Sep 27, 2026
Merged

modem7 merged 1 commit into
masterfrom
feature/vm-setup-uv

Conversation

@modem7

@modem7 modem7 commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

Adds uv to claude-code-vm-setup.sh, and makes it the Python convention in the generated CLAUDE.md.

Ubuntu 24.04's system Python refuses pip install (PEP 668, externally-managed-environment). The generated CLAUDE.md told Claude to force past that with --break-system-packages, which a live run hit straight away.

  • install_uv (phase 2, after Rust) installs uv and uvx into ~/.local/bin from Astral's GitHub release for the machine's arch (x86_64 / aarch64). The download is checked against the release's published sha256 before installing, the same approach as the Go install.
    • Re-runs: skipped if already current, upgraded if older.
    • A uv installed somewhere else (snap, pipx, /usr/local/bin) is left alone.
    • If the latest-release lookup fails, an existing uv is kept with a warning.
  • Generated CLAUDE.md now says to use per-project environments via uv (uv init + uv add, or uv venv + uv pip install, run with uv run), never to install into system Python, and to use uv tool install / uvx for Python CLI tools. The "Package managers" line lists uv instead of pip --break-system-packages.
  • Health check: a new uv line.
  • The webapp-testing skill's Playwright install keeps its --user --break-system-packages, now commented as the one deliberate exception: the skill's helper scripts run under plain python3.

uv also covers what pipx would (uv tool install, uvx), so pipx isn't added.

Test plan

  • shellcheck clean
  • install_uv in a fresh ubuntu:24.04 container:
    • fresh install → 0.12.19;
    • re-run → "already installed";
    • an older 0.12.0 in ~/.local/bin → upgraded to 0.12.19;
    • uv moved to /usr/local/bin → "managed elsewhere", untouched.
  • As the user afterwards: uv venv + uv pip install six + import from the venv works

Ubuntu's system Python refuses pip installs (PEP 668), and the generated
CLAUDE.md told Claude to force past it with --break-system-packages.
Install uv/uvx from Astral's checksum-verified GitHub release (upgraded
on re-run, left alone if managed elsewhere), point CLAUDE.md at
per-project uv environments, and add uv to the health check.
@modem7
modem7 merged commit e77acd6 into master Sep 27, 2026
4 checks passed
@modem7
modem7 deleted the feature/vm-setup-uv branch September 27, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant