-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support #328415
python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support #328415
Conversation
I prefer having to make the dependency on distutils explicit. |
He he ... see we comments on each other PR ;-) I can understand you point.But think it is better to make If you need to add |
c01c298
to
3d498dc
Compare
As I understand it I’m ambivalent between this and #328379. I prefer to source our |
I forgot that in #326321 we discovered that you can hold I’d still like to work on getting rid of all these references at some point though… |
Are you worried about it breaking due to incompatible versions? I doubt that would happen as the distutils code probably doesn't change.
Not really. There are probably many packages that indirectly depend on setuptools but don't import it because they use e.g. poetry instead. Those shouldn't be able to use distutils either. |
I dunno, there’s a whole bunch of commits in the repository you were using that postdate 3.12’s release. Fair point about the indirect dependencies thing. |
But that is the behavior in a normal python setup. If you have |
No, only after you |
@dotlambda try to make a normal plain vanilla python venv.
|
I think I lean towards @dotlambda’s updated PR at this point, but I’m wondering if anyone has any idea how we could just make the imports work as intended? Could we just make |
Instead of patching setuptools and requiring a gigantic rebuild of packages that do not need the changes, instead, why not make a patch for thrift? I've submitted one at apache/thrift#3007 , feel free to use the commit there as a patch. I've confirmed that it applies cleanly to the v0.20.0 tag, though it may require using fetchFromGitHub instead of fetchPypi to apply properly. |
Thanks 😊, that is also a possibility, have also an earlier PR where I just fix thrift, #328246 But there are multiple packages that loose python 3.12 support for sam reason. So why not fix nixpkgs setuptools so it behave as vanilla setuptools? |
… at the moment Depends on thrift that do not support python 3.12 at the moment. See PR NixOS#328415
setuptools have a trick/hack that make distutils avaliable for import. This do not work in nix build phase. This commit fix this.
3d498dc
to
731a9d1
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/missing-setuptools-dist-wheel-to-build-a-python-package/55780/1 |
Use |
Was apparently fixed in 3a30db4 |
Description of changes
distutils
was removed in python 3.12.setuptools
give backwards compatibility fordistutils
, by a trick/hack that makedistutils
available/importable whensetuptools
are installed. But this do not work in nix build phase.This break some python 3.12 packages builds in nixpkgs. For example the python package
thrift
is broken for python 3.12 but also other examples #328379.This PR make the
setuptools
support fordistutils
behave as expected, by symlink thedistutils
package insetuptools
todistutils
in site-packages.One concern, this touches
setuptools
implies big rebuild. But will makesetuptools
behave as expected and avoid confusions. There are as suggestion in #328379 to adddistutils
as it own package, but think it is better to fixsetuptools
, then introducing a packages that is gone.My earlier proposal:
#328182
Alternativ only fix thrift:
#328246
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.