pip 26.1 有什么新特性?锁文件和依赖冷却期!What's new in pip 26.1 - lockfiles and dependency cooldowns!
Python 包管理工具 pip 发布 26.1 版本,主要更新包括引入 lockfiles 支持以增强依赖一致性,以及新增 dependency cooldowns 功能来防止频繁下载同一包。该版本正式放弃对 Python 3.9 的支持,因其已于去年十月结束生命周期。这些改进旨在提升开发环境的可复现性和网络效率。
Simon Willison
28th April 2026 - Link Blog
What's new in pip 26.1 - lockfiles and dependency cooldowns! (via) Richard Si describes an excellent set of upgrades to Python's default pip tool for installing dependencies.
This version drops support for Python 3.9 - fair enough, since it's been EOL since October. macOS still ships with python3 as a default Python 3.9, so I tried out the new Python version against Python 3.14 like this:
uv python install 3.14
mkdir /tmp/experiment
cd /tmp/experiment
python3.14 -m venv venv
source venv/bin/activate
pip install -U pip
pip --versionThis confirmed I had pip 26.1 - then I tried out the new lock files:
pip lock datasette llmThis installs Datasette and LLM and all of their dependencies and writes the whole lot to a 519 line pylock.toml file - here's the result.
The new release also supports dependency cooldowns, discussed here previously, via the new --uploaded-prior-to PXD option where X is a number of days. The format is P-number-of-days-D, following ISO duration format but only supporting days.
I shipped a new release of LLM, version 0.31, three days ago. Here's how to use the new --uploaded-prior-to P4D option to ask for a version that is at least 4 days old.
pip install llm --uploaded-prior-to P4D
venv/bin/llm --versionThis gave me version 0.30.
需要完整排版与评论请前往来源站点阅读。