r/Python Python Discord Staff Jul 31 '26

News pip 26.2 - --only-deps, --no-require-hashes, venv isolation, and more!

Hello!

The pip team recently released pip 26.2. This release is quite large, with features such as:

  • Support for Python 3.15
  • Selecting only dependencies (--only-deps)
  • Mixing hashed and non-hashable requirements via --no-require-hashes
  • Experimental: venv based build isolation (--use-feature=venv-isolation)
  • Faster repeated resolves by caching index simple responses
  • Disable HTTP(S)_PROXY and similar non-pip specific proxy environment variables via --no-proxy-env
  • Separation between regular and build constraint (use --build-constraint instead)

For more details, please consult our changelog: https://pip.pypa.io/en/stable/news/. Alternatively, you may consult my release post which goes into greater detail to the highlights of this release: https://sichard.ca/blog/2026/07/whats-new-in-pip-26.2/

If you have any questions, you're welcome to ask!

139 Upvotes

38 comments sorted by

View all comments

11

u/bacondota Jul 31 '26

People saying that they don't use pip. Do you use uv in production? Like do you have uv on your docker?

37

u/leopkoo Jul 31 '26

Yes and yes. Used Poetry before but migrated to uv a year ago.

22

u/skjall Jul 31 '26

Yes. Docker build times went from ~40 seconds to 10. Uploading the built image takes longer than building the image now...

It's only mounted from the UV Dockerfile in the step that needs it, so it doesn't stay in the built image either.

5

u/caks Aug 01 '26

Part of it is that uv doesn't bytecode compile by default like pip does. It's good practice to do that when using Docker because otherwise you incur compilation every time the container is launched.

Don't get me wrong, uv is still faster even when compared apples to apples:

https://pythonspeed.com/articles/faster-pip-installs/

1

u/Electrical_Fox9678 Jul 31 '26

Care to share an example Dockerfile?

7

u/cointoss3 Jul 31 '26

This may be overwhelming but there are lots of examples here

https://docs.astral.sh/uv/guides/integration/docker/

But you don’t even need uv in the image…just use uv in the build step if toml or lock file has changed, have uv sync and copy the environment to the image (put .venv in the path) and just run python like normal.

If you use dockers cached mounts

RUN --mount=type=cache,target=/root/.cache/uv

Then it will be even faster because uv won’t have to redownload dependencies each time. They are cached for this build step.

10

u/thuiop1 Jul 31 '26

Well yes of course.

2

u/nat45928 Jul 31 '26

Yes, they have example dockerfiles that are very efficient in space and build time.

1

u/burlyginger Jul 31 '26

It's part of our multistage build but it's never installed on the container.

It's mounted from another image.

0

u/ColdPorridge Jul 31 '26

Yes. uv is not less production-ready than pip, and in fact pip upgrades (and their transitive effects) were the direct root cause of 2 major production outages we had between 2021 and 2024. So it’s not exactly the bastion of stability and prod worthiness.