Skip to content

python3Packages.certifi: fix build on Python 3.10#447787

Merged
mweinelt merged 1 commit intoNixOS:python-updatesfrom
VojtechStep:fixup/python-certifi-ascii
Jan 21, 2026
Merged

python3Packages.certifi: fix build on Python 3.10#447787
mweinelt merged 1 commit intoNixOS:python-updatesfrom
VojtechStep:fixup/python-certifi-ascii

Conversation

@VojtechStep
Copy link

@VojtechStep VojtechStep commented Oct 1, 2025

The previous commit #420216 to the patch removed too much when adjusting to upstream deprecating 3.7; in particular it removed the patch to the contents function on Python <3.11. Nixpkgs gives certifi its own cacert, which isn't preprocessed to be ASCII, which upstream expects, so the patch previously changed the encoding to utf-8.

Things done

The associated pytests run, and I checked that the package works as expected in the repo where it's a nested dependency (https://github.com/UniMath/agda-unimath)

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

The previous commit to the patch removed too much when adjusting to
upstream deprecating 3.7
@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-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. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: python Python is a high-level, general-purpose programming language. labels Oct 1, 2025
@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Oct 2, 2025
fredrik-bakke pushed a commit to UniMath/agda-unimath that referenced this pull request Oct 14, 2025
We used to support Python 3.8 because of Ubuntu 20.04, which doesn't
have LTS anymore. The successor, Ubuntu 22.04, comes with Python 3.10.
By upgrading we get tooling improvements --- we can update
`pre-commit-hooks` and `autopep8`, the latter of which was disabled IIRC
because the version we could use was buggy --- and we can also use new
Python features, such as pattern matching and type aliases.

~~There's no time pressure, so I'm keeping it as a draft for now, since
one nested Python dependency has recently been broken for Python 3.10 in
nixpkgs, but I submitted a PR
(NixOS/nixpkgs#447787) to fix that, and
temporarily replicated the fix here (with the disadvantage of it not
being prebuilt, hence waiting for the PR to be merged).~~
I got rid of the broken dependency by removing a dependency on
`requests`. We were only using it to perform a GET requests and looking
at its `Link` header, which can be done quite easily with Python's
built-in `urllib`.

Note that I updated pre-commit/prettier, but it's not maintained
anymore, because pre-commit apparently broke something, and IIUC there's
now no officially supported way of running prettier in pre-commit 🤷.

Fixes #939
fredrik-bakke pushed a commit to fredrik-bakke/agda-unimath that referenced this pull request Oct 17, 2025
We used to support Python 3.8 because of Ubuntu 20.04, which doesn't
have LTS anymore. The successor, Ubuntu 22.04, comes with Python 3.10.
By upgrading we get tooling improvements --- we can update
`pre-commit-hooks` and `autopep8`, the latter of which was disabled IIRC
because the version we could use was buggy --- and we can also use new
Python features, such as pattern matching and type aliases.

~~There's no time pressure, so I'm keeping it as a draft for now, since
one nested Python dependency has recently been broken for Python 3.10 in
nixpkgs, but I submitted a PR
(NixOS/nixpkgs#447787) to fix that, and
temporarily replicated the fix here (with the disadvantage of it not
being prebuilt, hence waiting for the PR to be merged).~~
I got rid of the broken dependency by removing a dependency on
`requests`. We were only using it to perform a GET requests and looking
at its `Link` header, which can be done quite easily with Python's
built-in `urllib`.

Note that I updated pre-commit/prettier, but it's not maintained
anymore, because pre-commit apparently broke something, and IIUC there's
now no officially supported way of running prettier in pre-commit 🤷.

Fixes UniMath#939
@mweinelt mweinelt changed the base branch from master to python-updates January 21, 2026 16:25
@mweinelt mweinelt merged commit 31777e4 into NixOS:python-updates Jan 21, 2026
35 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Python batch upgrade Jan 21, 2026
@VojtechStep VojtechStep deleted the fixup/python-certifi-ascii branch January 21, 2026 17:18
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. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 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-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. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

Development

Successfully merging this pull request may close these issues.

2 participants