Skip to content

treewide: remove disabled = pythonOlder where it's matching only removed Python #426616

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

Closed
wants to merge 13 commits into from

Conversation

acid-bong
Copy link
Contributor

@acid-bong acid-bong commented Jul 19, 2025

Commands used (also can be reproduced with):

fd -tf -x sed -i '/disabled = .*\.pythonOlder "3\.10";/d' \; -x sed -i '/disabled = pythonOlder "3\.10";/d' && (gif --name-only | rg '\.nix$' | xargs -n 1 -P 0 result/bin/nixfmt)

replacing 10 with numbers from 0 to 9.

Sadly, can't mass-test it with nixpkgs-review, but occasional builds do succeed.

Cleanup steps are described in the commits themselves.

Things done

  • Built on platform:
    • x86_64-linux (minor part)
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and others READMEs.

Add a 👍 reaction to pull requests you find important.

@acid-bong acid-bong changed the title pkgs/by-name: remove disabled = pythonOlder where it's matching only versions removed from Nixpkgs treewide: remove disabled = pythonOlder where it's matching only removed Python Jul 19, 2025
@nixpkgs-ci nixpkgs-ci 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 Jul 19, 2025
@acid-bong acid-bong force-pushed the cleanup/pythonDisabled branch from f976bcb to 42221ee Compare July 19, 2025 09:28
@acid-bong acid-bong changed the base branch from master to staging July 19, 2025 10:17
@nixpkgs-ci nixpkgs-ci bot closed this Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Jul 19, 2025
@acid-bong acid-bong force-pushed the cleanup/pythonDisabled branch from 77cce8d to e007f7f Compare July 19, 2025 10:37
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. and removed 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 Jul 19, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Jul 19, 2025
@acid-bong acid-bong force-pushed the cleanup/pythonDisabled branch from 2e8998a to f91f387 Compare July 19, 2025 15:04
@nixpkgs-ci nixpkgs-ci 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. 2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: games Gaming on NixOS and removed 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. labels Jul 19, 2025
@acid-bong acid-bong force-pushed the cleanup/pythonDisabled branch from e65c874 to 20a2e4f Compare July 19, 2025 16:23
@nixpkgs-ci nixpkgs-ci bot removed 2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab labels Jul 19, 2025
Cleaned up with
```sh
git diff --name-only staging | xargs -n 1 -P 0 deadnix -eq
```

Only files with `pythonOlder` removed selected by
```nix
git diff -G 'pythonOlder' --name-only | xargs git add
```

Manual interventions:
- top-level/python-packages.nix: Qt packages used `pythonOlder` in
  `callPackage` calls
This one required two windows:
- in one, i ran `git diff staging` and searched for the comments with
  this regex: ^\s*# (god bless Less)
- in another, i opened an editor and removed those lines
@Sigmanificient
Copy link
Member

Maybe worth mentioned a old attempt, that was cancelled:

From fabaff:

I don't agree with removing pythonOlder only because it mention "3.5". It should stay as it in many cases it was added manually and helps to track in some ways the state of the module in Nixpkgs. Same as going for modules which still use sha256, mention format = "setuptools"; or have six in their inputs.

While checking a couple of modules it showed that the entry is simply outdated. During mass updates pythonOlder is not checked. Also, upstream is not always aware what releases their module actually support and it doesn't have to align us. If upstream says python_requires=">=3.5" then our pythonOlder entry does reflect hat.

@wolfgangwalther
Copy link
Contributor

At this stage it would be great to get some feedback from @mweinelt and @natsukium on whether the change in this PR is wanted in general.

@acid-bong
Copy link
Contributor Author

whether the change in this PR is wanted in general.

and whether the PR itself is wanted

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 6, 2025
@acid-bong
Copy link
Contributor Author

Ight, @Sigmanificient @wolfgangwalther @fabaff (maybe also @GaetanLepage), what's yall's verdict on this: worth keeping or not?

@wolfgangwalther
Copy link
Contributor

From my perspective, this is certainly worth doing / keeping - but I feel like I lack the knowledge to tell why these conditions are there in the first place. If they are essentially similar to meta.broken in that they only concern combinations of in-tree python interpreters and these packages - then they should be removed, if the interpreter version is not there anymore. If there is more to them.. then maybe not. Is there more to them?

@acid-bong
Copy link
Contributor Author

acid-bong commented Aug 12, 2025

essentially similar to meta.broken in that they only concern combinations of in-tree python interpreters and these packages

yes, sorta: when a disabled package is evaluated, it errors with "PACKAGE doesn't support Python PYTHONVERSION", except it's Python-specific and is thus a top-level attr instead of meta one

@GaetanLepage
Copy link
Contributor

I am in favor of such a change. I don't think we are missing much of getting rid of these evaluation guard rails in practice.
I would rather not have them than keeping unmaintained (very old) lower bounds on the minimal supported python version.

Let's wait for a definitive answer from the official nixpkgs python maintainers.

@mweinelt
Copy link
Member

mweinelt commented Aug 12, 2025

Yes, we want structural clean-up. However, I think everything beyond a single atomic commit per operation (remove obsolete pythonOlder, replace negated pythonOlder) would be too noisy.

And given that this is an operation we need to repeat, I think creating a script for the complete workflow would be the way to go.

@wolfgangwalther
Copy link
Contributor

I agree, making this repeatable seems very useful. Should be run whenever a python version is dropped.

@acid-bong
Copy link
Contributor Author

creating a script for the complete workflow would be the way to go

what if there's multiple versions mentioned, translated from, say, ">=3.8,<3.12" (which is disabled = pythonOlder "3.8" || pythonAtLeast "3.12")?

@wolfgangwalther
Copy link
Contributor

I'd say the script should not worry about 100% perfection, but about doing the biggest chunk of work possible, and reliably and reviewable so. You can still grep for these kind of things and fix them manually.

@wolfgangwalther
Copy link
Contributor

For a script, also consider #427098, which introduces ast-grep support - I think this would be a perfect use-case for something like that. It's even possible to write tests for that script this way.

@acid-bong
Copy link
Contributor Author

mkay then, I'll try to write a script and then remake this PR with it

@acid-bong acid-bong marked this pull request as draft August 13, 2025 11:40
@Sigmanificient
Copy link
Member

#433233 (comment)

@acid-bong
Copy link
Contributor Author

Nah, i lost motivation, sorry for bothering yall 🙏

@acid-bong acid-bong closed this Aug 21, 2025
@acid-bong acid-bong deleted the cleanup/pythonDisabled branch August 21, 2025 16:27
@Sigmanificient
Copy link
Member

I'm sorry to hear that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python Python is a high-level, general-purpose programming language. 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.

5 participants