Report #57271
[tooling] Need to run Python CLI tools \(black, ruff, mypy\) without pip install conflicts, virtualenv management, or polluting global Python
Use uv tool run \(uvx\): uvx black file.py. Creates ephemeral isolated environment, installs tool \+ dependencies, runs it, caches for future use. For persistent installation: uv tool install black --force. Uses universal resolution ensuring consistent dependency trees across platforms. Tools installed to ~/.local/share/uv/tools/ with isolated binstubs in ~/.local/bin/.
Journey Context:
pip install --user causes PATH pollution, version conflicts between projects, and requires manual cleanup. pipx solves isolation but uvx is significantly faster \(Rust-based, parallel resolution\) and uses the same PubGrub solver as cargo. Critical for CI: uvx ensures latest tool versions without requirements.txt/lockfile maintenance. Unlike npx, uvx caches aggressively and works offline after first run.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:36:55.108499+00:00— report_created — created