Skip to content

[python-updates] python3: 3.13 -> 3.14 - #521373

Merged
mweinelt merged 148 commits into
stagingfrom
python-updates
May 30, 2026
Merged

mweinelt merged 148 commits into
stagingfrom
python-updates

Conversation

@mweinelt

@mweinelt mweinelt commented May 17, 2026 •

Copy link
Copy Markdown
Member

We update the major python3 version from 3.13 to 3.14. This change is planned for the first staging cycle after NixOS 26.05 is branched.

Important changes:

  • setuptools updated beyond 82.0, which removes pkg_resources
  • setuptools_80 pinned for packages who can't make the jump yet (for pkg_resources and some distutils api breakage in copy_file)

Hydra jobset: https://hydra.lossy.network/jobset/nixpkgs/python-updates
Eval report: https://shells.darmstadt.ccc.de/~hexa/38076.html

@mweinelt

Copy link
Copy Markdown
Member Author

Thanks for the review.

@dotlambda

Copy link
Copy Markdown
Member

setuptools updated beyond 82.0, which removes pkg_resources

How do we deal with that for packages which need setuptools in their dependencies because they import pkg_resources?
Right now the only option would be

meta.broken = lib.versions.versionAtLeast setuptools.version "82";

sphinxHook
setuptools
setuptools_80
setuptools-scm

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't setuptools-scm propagate setuptools?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works because this determines the order in the PYTHONPATH.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 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. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab labels May 19, 2026
@mweinelt

Copy link
Copy Markdown
Member Author

How do we deal with that for packages which need setuptools in their dependencies because they import pkg_resources?

One of the tensor* things is one of them. If they are leaf packages, then whatever. If they aren't we need to think long and hard how to resolve this.

@dotlambda

Copy link
Copy Markdown
Member

@mweinelt Do you still have the pandas src with the old hash?

@mweinelt

Copy link
Copy Markdown
Member Author
❯ diff -r /tmp/pandas-old /tmp/pandas-new
diff '--color=auto' -r /tmp/pandas-old/pandas/_version.py /tmp/pandas-new/pandas/_version.py
28c28
<     git_refnames = " (tag: v3.0.3, 3.0.x)"
---
>     git_refnames = " (tag: v3.0.3)"

@dotlambda

dotlambda commented May 19, 2026 •

Copy link
Copy Markdown
Member

I don't understand why this file is generated by GitHub for the source tarball.
EDIT: Never mind, this file was removed on upstream's main branch but is still present on 3.0.3.

@mweinelt
mweinelt marked this pull request as ready for review May 30, 2026 01:54
@mweinelt
mweinelt enabled auto-merge May 30, 2026 01:57
@mweinelt
mweinelt added this pull request to the merge queue May 30, 2026
Merged via the queue into staging with commit aa06a08 May 30, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Stdenv May 30, 2026
@trofi

trofi commented May 30, 2026

Copy link
Copy Markdown
Contributor

Bisect says adb4fcc python3: 3.13 -> 3.14 caused eval failures for noto-fonts-color-emoji:

$ nix-instantiate -A noto-fonts-color-emoji
error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'noto-fonts-color-emoji-2.051'
         whose name attribute is located at /tmp/bisect/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:651:11

       … while evaluating attribute 'nativeBuildInputs' of derivation 'noto-fonts-color-emoji-2.051'
         at /tmp/bisect/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:719:11:
          718|           depsBuildBuild = buildBuildOutputs;
          719|           nativeBuildInputs = buildHostOutputs;
             |           ^
          720|           depsBuildTarget = buildTargetOutputs;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: fs-2.4.16 not supported for interpreter python3.14

Probably via python3Packages.psautohint:

$ nix-instantiate -A noto-fonts-color-emoji --show-trace |& grep attr
         whose name attribute is located at /tmp/bisect/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:651:11
       … while evaluating attribute 'nativeBuildInputs' of derivation 'noto-fonts-color-emoji-2.051'
       … while evaluating the attribute 'out.outPath'
         whose name attribute is located at /tmp/bisect/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:651:11
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'nototools-0.3.2'
       … while evaluating the attribute 'out.outPath'
       … while evaluating the attribute 'out.outPath'
         whose name attribute is located at /tmp/bisect/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:651:11
       … while evaluating attribute 'propagatedBuildInputs' of derivation 'python3.14-psautohint-2.4.0'

@mweinelt

mweinelt commented May 30, 2026 •

Copy link
Copy Markdown
Member Author

https://github.com/PyFilesystem/pyfilesystem2 is unmaintained
https://github.com/adobe-type-tools/psautohint is archived

Luckily psautohint consumes fs via fonttools.ufo and the kind fonttools people removed their dependency on fs.

@mweinelt

Copy link
Copy Markdown
Member Author

Fixed in #525906

@vbgl

vbgl commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

FYI, the update of setuptools (a0d82aa) broke the fstar package (and more precisely its z3-4.8.5 dependency):

File "/nix/store/pa3z0fx6pqmyli0chmpr8pqjhpzb8mm3-z3-4.8.5-python/lib/python3.14/site-packages/z3/__init__.py", line 1, in <module>
    from .z3 import *
File "/nix/store/pa3z0fx6pqmyli0chmpr8pqjhpzb8mm3-z3-4.8.5-python/lib/python3.14/site-packages/z3/z3.py", line 45, in <module>
    from . import z3core
File "/nix/store/pa3z0fx6pqmyli0chmpr8pqjhpzb8mm3-z3-4.8.5-python/lib/python3.14/site-packages/z3/z3core.py", line 5, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

@mweinelt

mweinelt commented Jul 24, 2026 •

Copy link
Copy Markdown
Member Author

The pkg_resources module was deprecated a while ago and finally removed. If you still need it, pin setuptools_80.

@vbgl

vbgl commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for the hint.

wegank pushed a commit to loongson-community/nixpkgs that referenced this pull request Oct 30, 2026
Package failed to build due to:

```
stytra/gui/buttons.py:4: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'
```

Root cause is related to `setuptools` removing `pkg_resources` module
as part of `v82.0.0` release [1]. This was eventually updated in
`nixpkgs` as part of NixOS#521373 on 2026/05/29. Build failure of this
package on unstable begin on 2026/07/09 (roughly aligning with usual
staging cycle).

Simply add standalone redistribution of pkg_resources to fix build

[1] pypa/setuptools@8ba2f38
@Sigmanificient Sigmanificient mentioned this pull request Oct 31, 2026
2 of 13 tasks
anthonyroussel added a commit to anthonyroussel/nixpkgs that referenced this pull request Nov 12, 2026
Python 3.14 is now the default python3, and argparse rejects nested
mutually exclusive groups, which broke the CLI and its tests:

  ValueError: mutually exclusive groups cannot be nested

Add the operating actions directly to the parent group, which is
equivalent. Not fixed upstream yet.

Related: NixOS#521373
Related: aws/aws-encryption-sdk-cli#434
Hydra: https://hydra.nixos.org/build/352568565
ZHF: NixOS#584347
anthonyroussel added a commit to anthonyroussel/nixpkgs that referenced this pull request Nov 12, 2026
Python 3.14 is now the default python3, and argparse rejects nested
mutually exclusive groups, which broke the CLI and its tests:

Related: NixOS#521373
Related: aws/aws-encryption-sdk-cli#434
Hydra: https://hydra.nixos.org/build/352568565
ZHF: NixOS#584347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment 8.has: package (new) This PR adds a new package 8.has: package (update) This PR updates a package to a newer version 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

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants