Skip to content

python2Packages.hypothesis: remove enum34#389263

Merged
FliegendeWurst merged 1 commit intoNixOS:masterfrom
bengsparks:hypothesis
Mar 12, 2025
Merged

python2Packages.hypothesis: remove enum34#389263
FliegendeWurst merged 1 commit intoNixOS:masterfrom
bengsparks:hypothesis

Conversation

@bengsparks
Copy link
Contributor

Part of efforts to finish #349607.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 12, 2025
Copy link
Member

@FliegendeWurst FliegendeWurst left a comment

Choose a reason for hiding this comment

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

python2Packages.hypothesis does not eval anyway, so this seems safe enough

@FliegendeWurst FliegendeWurst merged commit 53152eb into NixOS:master Mar 12, 2025
23 of 27 checks passed
@FliegendeWurst FliegendeWurst mentioned this pull request Mar 12, 2025
21 tasks
@bengsparks bengsparks deleted the hypothesis branch March 12, 2025 18:09
@bryango
Copy link
Member

bryango commented Mar 21, 2025

python2Packages.hypothesis does not eval anyway

Before this PR, python2Packages.hypothesis did eval successfully with allowUnsafe. Hence the patch broke hypothesis on python 2.7, which is unfortunately necessary for some legacy applications (such as gimp2 plugins). Is it okay if I make a PR to revert this patch? 🥺 I know python2 is unsafe (and not evaluated by hydra) but it is still relied on by some old apps, unfortunately...

@FliegendeWurst
Copy link
Member

It doesn't for me, due to dependency on trove-classifiers

$ NIXPKGS_ALLOW_INSECURE=1 nix-shell -I nixpkgs=. -p python2Packages.hypothesis
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'shell'
         whose name attribute is located at /home/arne/nixpkgs-wt-2/pkgs/stdenv/generic/make-derivation.nix:375:7

       … while evaluating attribute 'buildInputs' of derivation 'shell'
         at /home/arne/nixpkgs-wt-2/pkgs/stdenv/generic/make-derivation.nix:422:7:
          421|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          422|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          423|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

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

       error: trove-classifiers-2025.1.15.22 not supported for interpreter python2.7

For that matter this PR does not affect eval, only functionality

@bryango
Copy link
Member

bryango commented Mar 21, 2025

Ah interesting, so I took a closer look: my dependence of hypothesis is through pytest which actually overrides it to disable tests:

pytest = pytest_4;
pytest_4 = callPackage ../development/python2-modules/pytest {
# hypothesis tests require pytest that causes dependency cycle
hypothesis = self.hypothesis.override {
doCheck = false;
};
};

python2Packages.hypothesis.override { doCheck = false; } did evaluate before because it does not depend on trove-classifiers. Is it okay to fix the eval by always setting doCheck = false (and revert this PR)? 🥺

If not, I am fine with maintaining a local fork. I understand that python2 is deprecated.

@FliegendeWurst
Copy link
Member

This PR cannot be reverted, enum34 is gone: #387576

@bengsparks
Copy link
Contributor Author

You should probably do a local fork.
Python2 is an entirely neglected part of nixpkgs, and I'm currently doing my best to remove every mention of it that I can find. Especially now that Gimp3 has been released, the reasons to keep anything from Python2 still around are far and few between.

@bryango
Copy link
Member

bryango commented Mar 21, 2025

This PR cannot be reverted, enum34 is gone: #387576

I see... I didn't notice because it's in staging and hasn't hit master yet, but now I see that it's only a matter of time... Thanks for the information.

I'm currently doing my best to remove every mention of it that I can find. Especially now that Gimp3 has been released, the reasons to keep anything from Python2 still around are far and few between.

This should be preferred if there is a viable replacement; however, the gimp resynthesizer plugin currently only builds with python2 & gimp2. The gimp3 replacement is still a work in progress, so no replacement viable for the time being.

In any case, I can work with a local fork for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants