💬 观点Simon Willison
Using uvx in GitHub Actions in a cache-friendly way — 如何让 uvx 在 GitHub Actions 中缓存友好地使用 Python
如何让 uvx 在 GitHub Actions 中缓存友好地使用 Python 工具。
2026-07-14原文
本文为要点摘要,完整细节以原文为准。
- 设置
UV_EXCLUDE_NEWER环境变量为固定日期(如2026-07-12),使 uvx 始终解析该日期前的最新版本,避免每次运行都下载最新版。 - 将该日期作为 GitHub Actions 缓存键的一部分,通过手动更新日期来触发缓存失效和工具升级。
- 此方法避免了每次工作流运行时从 PyPI 重新下载工具及其依赖,显著提升 CI 速度和可靠性。
原文:Using uvx in GitHub Actions in a cache-friendly way · 作者 Simon Willison