r/Python • Python Discord Staff • Apr 27 '26

News pip 26.1: experimental support for installing lockfiles + dependency cooldowns!

Hey all,

I'm one of the maintainers of pip. Earlier yesterday, we released pip 26.1.

The main new feature is experimental support for pylock.toml files (PEP 751) as a requirements source. pylock.toml files or URLs can be provided with the -r / --requirements options to the commands supporting it.

pip install -r pylock.toml
pip wheel -r pylock.toml
pip download -r pylock.toml

Note*: As conveyed by the experimental warning, keep in mind this feature may evolve significantly or even be removed in favor of another option or command in future pip releases.*

Other notable improvements include:

  • Allow --uploaded-prior-to to accept a duration in days (e.g., P7D for 7 days ago) to support "Dependency cooldowns", a strategy of intentionally delaying package updates to give security researchers and package authors time to recover from (ever-increasing) supply chain attacks. See also William Woodruff's "We should all be using dependency cooldowns"
  • Allow unpinned requirements to use hashes from constraints and allow URL constraints to apply to requirements with extras, removing some of the last roadblocks towards the removal of the legacy resolver
  • Several performance and memory usage improvements to dependency resolution
  • And of course several bug fixes and security fixes

Please consult our changelog for more information.

You can also consult my (unofficially official) release blog post for pip 26.1, which discusses the highlights from the release in greater detail: https://ichard26.github.io/blog/2026/04/whats-new-in-pip-26.1/

Many thanks goes to Stéphane, Damian, Pradyun and Paul who all chipped in a significant way to this release. Doubly so to Stéphane who upstreamed support for pylock.toml to the packaging library AND added pylock.toml support to pip.

Enjoy the new features! We welcome your feedback in the issue tracker.

118 Upvotes

25 comments sorted by

View all comments

66

u/mischiefs Apr 28 '26

good to hear the steady improvements over pip. despite uv being awesome, i think is good to not get very comfortable with them now that openai bought astral.

5

u/mtgomes Apr 28 '26

I agree. Since the news I've been checking how to move away quickly in case / when OpenAI does something strange.. Still a big fan of uv and the team, but best to be prepared

10

u/Competitive_Travel16 Apr 28 '26

uv feels to me like giving up too much direct control. How do I know whether or not it will be available in a client deployment? And if it isn't, do I want to ask them them to go through a uv install? In both cases, I do not. pip is there for me on all the python...-slim docker images, and easy to upgrade to get it to jump through all these cool new hoops without giving up assumptions that uv involves.

17

u/thuiop1 Apr 28 '26

How do I know whether or not it will be available in a client deployment? And if it isn't, do I want to ask them them to go through a uv install?

Given that you can install it with pip, this feels like a non-issue.

3

u/Competitive_Travel16 Apr 28 '26

I see where you are coming from, but the uv internals are just too opaque for my comfort. I can wait a few extra tens of seconds for the infrequent builds. I suspect I will probably come around once I get some time to really study what all uv does.

1

u/Competitive_Travel16 Apr 29 '26

...also, if I use pip to install uv and then use uv to do what I would have used pip for, am I really saving much time for my client's infrequent builds?

2

u/MrSlaw Apr 30 '26

I mean, do you reinstall pip every time you want to use it, or do you install it once globally and then use it to add dependencies to your venv? It's the same process essentially.

But even if you do use pip to install uv, it's still quite a bit quicker (ex. 1.8s to install numpy via pip, vs 0.60s adding both uv and numpy), with both caches cleared.

1

u/Competitive_Travel16 Apr 30 '26

Interesting. I always upgrade pip on every build and in my devserver script. It's that devserver where I think pip does slow me down. I promise to look in to uv.

1

u/Competitive_Travel16 Apr 30 '26

^ underrated question, even if I do say so myself

3

u/SwampFalc Apr 28 '26

I like uv on my development machine, but I create artifacts that do not require it. It has no reason to exist on a production machine, as far as I am concerned.

1

u/readonly12345678 Apr 28 '26

There shouldn’t be a difference. uv leverages pypi.

Also, if you don’t controlled the deployed client, I highly advise not having it depend on separately downloading the dependencies.

1

u/Competitive_Travel16 Apr 28 '26

I don't want to ship frozen dependencies which turn out to have vulnerabilities in them.

1

u/readonly12345678 Apr 29 '26

You re-ship the frozen client then?

1

u/Competitive_Travel16 Apr 30 '26

My web app clients are quite fluid, primarily because my paying clients always want enhancements.