Skip to content

python3: patch bundled pip - #580722

Open
mBornand wants to merge 7 commits into
NixOS:stagingfrom
mBornand:cpython-patch-wheel
Open

mBornand wants to merge 7 commits into
NixOS:stagingfrom
mBornand:cpython-patch-wheel

Conversation

@mBornand

@mBornand mBornand commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Things done

  • certifi: Add more fallback paths
  • python3: Patch pip bundled by ensurepip to use system ca cert store

Note we cannot replace cacert.pem in the wheel with our own, since cacert depends on python to build.

Tested with

python -m venv .vtest
. .vtest/bin/activate
pip install numpy

I only tested with #580719 since I am unable to rebuild it without on my setup.

Alternative to and in part inspired by #576524
Related to #576542

NIX_SSL_CERT_FILE is not always set, add more fallbacks in this case
ensurepip bundles pip. Patch pip's certifi.

When zlib is not available (withMinimalDeps) ensurepip will allways
fails since it can not unpack the pip wheel. Just remove enusrepip since
it can not work.
@nixpkgs-ci
nixpkgs-ci Bot requested a review from mweinelt October 29, 2026 23:35
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 6.topic: python Python is a high-level, general-purpose programming language. labels Oct 29, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from GaetanLepage October 30, 2026 08:56
@mBornand

mBornand commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Since there is no system ca store in the build environment some tests failed. I fixed those I found.

There are probably, other packages that will fail tests, because they now need cacert, but I can probably not test every package.

@nixpkgs-ci
nixpkgs-ci Bot requested a review from doronbehar October 30, 2026 09:15
@nixpkgs-ci
nixpkgs-ci Bot requested review from a team and alyssais October 30, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant