Fun with uv and PEP 723

Enthusiasm for uv’s Speed and UX

  • Many commenters report uv feeling “suspiciously fast” compared to pip, pyenv, Poetry, etc.—both for resolving/installing dependencies and starting tools.
  • Speed is attributed less to Rust per se and more to design choices: cross-environment installs, smarter caching (uncompressed wheels, hard-links), avoiding bootstrapping pip into every venv, less legacy baggage, and fewer unnecessary imports.
  • Several people say uv is the first Python tool that makes dependency management feel “Node-like” or comparable to Maven/Go in convenience.

How uv, uvx, and PEP 723 Work

  • uv is a Python package/project manager that also installs isolated Python interpreters; it uses virtual environments, not hardware virtualization.
  • uv run --script uses PEP 723 “inline script metadata” in comments to auto-resolve and cache dependencies per script; envs are ephemeral or reused via a content-addressed store, so space usage stays low.
  • uvx runs console entry points from PyPI packages; it doesn’t directly run arbitrary .py files, though you can approximate this with --with and python.
  • PEP 723 is now part of the official packaging spec and is also supported by tools like pipx.

Virtualenvs, Packaging, and Ecosystem Comparisons

  • Long debate on virtualenv design:
    • Critics call venvs a leaky, historical hack that aren’t portable and require awkward activation compared to “just folders + config” (e.g., Java/Maven).
    • Defenders say venvs are simple directories plus pyvenv.cfg; activation is optional; non-relocatability mainly comes from absolute paths in wrapper scripts, which could be changed.
  • Broader comparison:
    • Java/Maven and Go praised for single-artifact distribution and no C-extension headaches.
    • Python packaging history (setup.py, C deps, venvs) seen as messy; uv + modern PEPs viewed as finally cleaning this up.
    • Some still prefer Go/Rust for one-off binaries; others now favor Python one-shots thanks to uv + PEP 723 and richer libraries.

Shell Scripts and Cross-Language Tooling

  • Several people wish shell had a uv-like dependency layer; others argue that needing dependencies means you’ve outgrown shell.
  • Alternatives mentioned: Nix/Guix (nix-shell, nix run, Guix shell), mise, babashka, conda wrappers. Opinions split between “Nix is overkill but universal” and “uv/mise are simpler and more pragmatic.”

Reproducibility, Locking, and Longevity

  • Concern: inline scripts without lockfiles may break over time if dependencies update.
  • Responses:
    • PEP 723 allows version pins; uv supports script lockfiles and date-based resolution limits.
    • Some argue Python deps are relatively stable; others counter with examples (e.g. NumPy 2.0) and insist strict pinning is necessary.
  • Many believe uv is likely to become the de facto standard, though a few remain wary of yet another third-party tool and the “infomercial” vibe of recent hype.