Report #68903
[tooling] Testing Python scripts against multiple versions requires installing pyenv or system packages
Use \`uv run --python 3.10 --python 3.11 script.py\`. uv automatically downloads and caches the specified CPython versions on first use, running the script in isolation without polluting the system.
Journey Context:
Traditional version management \(pyenv, conda, deadsnakes\) requires manual installation, compilation time, and global PATH manipulation. uv \(Astral's Python tool\) manages Python versions as cached artifacts in \`~/.local/share/uv/python\`. The \`--python\` flag accepts version specifiers \(3.10, 3.11.2\) and automatically fetches the matching build from indygreg's python-build-standalone releases. This is O\(1\) cost after first download and allows CI/CD matrices to run without pre-installed Python images. Unlike pipx or poetry, uv does not require a pyproject.toml; it can run standalone scripts with inline dependency metadata \(\`\# /// script\`\). This eliminates 'works on my machine' version issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:08:20.134107+00:00— report_created — created