Skip to content

python/hooks: restore catchConflictHook for python<3.10#267669

Merged
mweinelt merged 2 commits intoNixOS:masterfrom
mweinelt:catch-python2-conflicts
Nov 18, 2023
Merged

python/hooks: restore catchConflictHook for python<3.10#267669
mweinelt merged 2 commits intoNixOS:masterfrom
mweinelt:catch-python2-conflicts

Conversation

@mweinelt
Copy link
Member

@mweinelt mweinelt commented Nov 15, 2023

By restoring and diverting to the old version.

Previously the newer language features and use of more modern stdlib imports broke the hook on Python<3.10.

Fixes https://hydra.nixos.org/build/240532695/nixlog/2

cc #263535

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux (built resholve)
    • 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/)
  • 23.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 15, 2023
@mweinelt
Copy link
Member Author

@ofborg eval

@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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 Nov 15, 2023
Copy link
Member

@natsukium natsukium left a comment

Choose a reason for hiding this comment

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

I confirmed that python2 itself and some python2-modules can be built.

@vcunat
Copy link
Member

vcunat commented Nov 16, 2023

The rebuild seems way too big for staging-next at this point, unless this fix is really critical.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 16, 2023
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

fine for me to go the easy way for python2

@mweinelt
Copy link
Member Author

The rebuild seems way too big for staging-next at this point, unless this fix is really critical.

I'm fine with leaving python2 broken in this cycle.

@vcunat vcunat marked this pull request as draft November 16, 2023 21:04
@mweinelt mweinelt changed the base branch from staging-next to staging November 17, 2023 17:18
@mweinelt mweinelt force-pushed the catch-python2-conflicts branch from 5cc5dee to 82d5b90 Compare November 17, 2023 17:18
@mweinelt mweinelt changed the title python/hooks: restore catchConflictHook for python2 python/hooks: restore catchConflictHook for python<3.10 Nov 17, 2023
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment labels Nov 17, 2023
@mweinelt
Copy link
Member Author

Rebased and extended the scope for the old hook to include everything up to and including 3.9.

This is because the importlib.metadata module in that version is lacking.

pythonCatchConflictsPhase
Traceback (most recent call last):
  File "/nix/store/qzdnf36li7zrnr95dhpc1w1i61ifw4s6-catch_conflicts.py", line 15, in <module>
    packages[dist._normalized_name].append(
AttributeError: 'PathDistribution' object has no attribute '_normalized_name'

@mweinelt mweinelt marked this pull request as ready for review November 17, 2023 17:19
@mweinelt mweinelt requested review from Mic92 and zowoq as code owners November 17, 2023 17:19
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 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 Nov 18, 2023
@mweinelt mweinelt marked this pull request as draft November 18, 2023 11:57
By restoring and diverting to the old version.

Previously the newer language features and use of more modern stdlib
imports broke the hook on Python<3.10.
@mweinelt mweinelt force-pushed the catch-python2-conflicts branch from 94eedee to f292ef4 Compare November 18, 2023 11:57
@mweinelt mweinelt changed the base branch from staging to master November 18, 2023 11:57
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: emacs Text editor and removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: emacs Text editor labels Nov 18, 2023
This reverts commit 397a8fd.

The hook now uses the old implementation based on the deprecated
pkg_resources library provided by setuptools again.
@mweinelt mweinelt marked this pull request as ready for review November 18, 2023 12:58
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 18, 2023
@mweinelt mweinelt merged commit 2203d3b into NixOS:master Nov 18, 2023
@mweinelt mweinelt deleted the catch-python2-conflicts branch November 18, 2023 23:04
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: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants