Skip to content
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

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

Merged
merged 2 commits into from
Nov 18, 2023

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.

@mweinelt
Copy link
Member Author

@ofborg eval

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 reputable 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 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 8.has: changelog 6.topic: rust 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
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 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants