Skip to content

python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support#328182

Closed
kfollesdal wants to merge 2 commits intoNixOS:masterfrom
kfollesdal:kfollesdal/python312-support-thrift
Closed

python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support#328182
kfollesdal wants to merge 2 commits intoNixOS:masterfrom
kfollesdal:kfollesdal/python312-support-thrift

Conversation

@kfollesdal
Copy link
Contributor

Description of changes

The python package thrift is broken for python 3.12. The reason is that thrift use distutils that was removed in 3.12, to build.

But setuptools give backwards compatibility for distutils. But it was a bug in setuptools that broke the build process for thrift.

See PR in setuptools, that we use as a patch in setuptools to solve the problem: pypa/setuptools#4484

One concern, since this touches setuptools that many python packages depend on, implies big rebuild.

Is this something we will backport to 24.05 to give python.3.12 support for thrift?

This can maybe solve python 3.12 for other packages also.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

…mpile

This fix solve python 3.12 support for python3Packages.thrift. And maybe
other?
Commit ## fix python 3.12 support.
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jul 18, 2024
@kfollesdal kfollesdal requested review from fabaff and tjni July 18, 2024 13:51
@kfollesdal kfollesdal changed the title python3Packages.setuptools, thrift: Fix bug in setuptools to give thrift python 3.12 support python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support Jul 18, 2024
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 8.has: package (new) This PR adds a new package labels Jul 18, 2024
@ofborg ofborg bot requested review from hbunke, mweinelt and natsukium July 18, 2024 15:28
@ofborg ofborg bot added 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. labels Jul 18, 2024
@mweinelt mweinelt marked this pull request as draft July 18, 2024 15:36
@mweinelt
Copy link
Member

Let's wait whether upstream agrees with the approach. Marking as draft, since it also targets the wrong branch (master, instead of staging).

# PR: https://github.com/pypa/setuptools/pull/4484
# Fix error, ModuleNotFoundError: No module named 'distutils', for function byte_compile
name = "fix-byte-complie.patch";
url = "https://patch-diff.githubusercontent.com/raw/pypa/setuptools/pull/4484.patch";
Copy link
Member

Choose a reason for hiding this comment

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

It is not clear whether upstream will accept the patch as is, because there's a clear separation between what's in setuptools/_distutils (which does not depend on setuptools, and whose patches should be sent to https://github.com/pypa/distutils) and the rest. I'd suggest putting the patch in the Nixpkgs tree.

@kfollesdal
Copy link
Contributor Author

Close this PR for now. Found a simpler solutions with less impact: #328246

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. 8.has: package (new) This PR adds a new package 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants