Skip to content

Manage Python with uv + 7-day minimum release age#23

Open
akan72 wants to merge 1 commit into
mainfrom
akan72/uv-python-management
Open

Manage Python with uv + 7-day minimum release age#23
akan72 wants to merge 1 commit into
mainfrom
akan72/uv-python-management

Conversation

@akan72
Copy link
Copy Markdown
Owner

@akan72 akan72 commented May 29, 2026

Summary

Manage Python with uv, with a rolling 7-day minimum release age for supply-chain safety. (Additional request, not in the original branch plan.)

  • Add uv/uv.toml with:
    • exclude-newer = "7 days" — a rolling window (a duration, not a fixed date) so uv never resolves a package release younger than a week. Most malicious/compromised uploads are detected and yanked within that window.
    • python-preference = "managed" — uv owns Python version management (install with uv python install <ver>, pin per-project via .python-version).
  • Symlink uv/uv.toml~/.config/uv/uv.toml in assimilate.sh (also discovered via $XDG_CONFIG_HOME).
  • Add brew "uv" to the Brewfile and run uv python install during assimilate to install a uv-managed CPython on fresh machines.

Notes

  • exclude-newer accepting a duration string was verified against the installed uv (0.11.6); an invalid value is rejected at parse time, a valid "7 days" is accepted.
  • Config lives top-level in uv.toml (the [tool.uv] table form is only for pyproject.toml).

Why & alternatives

Change Why Alternatives
exclude-newer = "7 days" Rolling supply-chain window — wait out the period where most malicious uploads get caught. A fixed exclude-newer date (must be bumped manually); no protection at all.
python-preference = "managed" Let uv own Python versions instead of hardcoded python3.11 aliases / pyenv. Keep pyenv, or only-managed to forbid system interpreters entirely.
brew "uv" + uv python install Reproducible uv + a managed Python on fresh machines. Install uv via the standalone installer (current local setup).

- Add uv/uv.toml with exclude-newer = "7 days" (rolling supply-chain window:
  never resolve a package release younger than a week) and
  python-preference = "managed" so uv owns Python version management
- Symlink uv/uv.toml -> ~/.config/uv/uv.toml in assimilate.sh (also discovered
  via $XDG_CONFIG_HOME)
- Add brew "uv" to the Brewfile and run 'uv python install' during assimilate
  to install a uv-managed CPython on fresh machines
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