Skip to content

treewide: modernize Python package pytest flags and move away from pytestFlagsArray#424782

Merged
mweinelt merged 6 commits intoNixOS:stagingfrom
ShamrockLee:pytestFlags-misc
Jul 15, 2025
Merged

treewide: modernize Python package pytest flags and move away from pytestFlagsArray#424782
mweinelt merged 6 commits intoNixOS:stagingfrom
ShamrockLee:pytestFlags-misc

Conversation

@ShamrockLee
Copy link
Contributor

Use (enabled|disabled)(TestPaths|TestMarks|Tests) and pytestFlags instead of the __structuredAttrs-incompatible pytestFlagsArray.

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 25.05 NixOS Release notes)
    • (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, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 13, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 13, 2025
@ShamrockLee ShamrockLee force-pushed the pytestFlags-misc branch 3 times, most recently from 74c2c9f to 267de9f Compare July 13, 2025 09:50
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 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: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab labels Jul 13, 2025
@ShamrockLee ShamrockLee force-pushed the pytestFlags-misc branch 2 times, most recently from c86d497 to 9a2baca Compare July 13, 2025 10:47
@ShamrockLee ShamrockLee marked this pull request as ready for review July 13, 2025 11:16
@ShamrockLee ShamrockLee mentioned this pull request Jul 13, 2025
12 tasks
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 13, 2025
…isabledTestPaths instead of pytestFlagsArray
disabledTests no longer Bash-expand as array elements
and thus no longer swallow parameters between square brackets.
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 14, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

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

Thank you so much for taking on this huge effort to migrate pytestFlagsArray.

Diff LGTM.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 14, 2025
Use `(enabled|disabled)(TestPaths|TestMarks|Tests)` and `pytestFlags`
instead of the `__structuredAttrs`-incompatible `pytestFlagsArray`.
@ShamrockLee
Copy link
Contributor Author

Oops! I forgot to push the new python3Packages.scikit-image change.

Pushed.

@mweinelt mweinelt merged commit f4614c2 into NixOS:staging Jul 15, 2025
23 of 27 checks passed
@philiptaron
Copy link
Contributor

git bisect says that this broke python3Packages.imageio.

@ShamrockLee
Copy link
Contributor Author

git bisect says that this broke python3Packages.imageio.

Could you share the error message? I guess there might be some typos.

@wolfgangwalther
Copy link
Contributor

git bisect says that this broke python3Packages.imageio.

Could you share the error message? I guess there might be some typos.

It fails with a lot of these:

E               RuntimeError: Cache directory is corrupt. Delete `.test_images` at project root.

Full log: https://logpaste.com/EtJszpL3

@wolfgangwalther
Copy link
Contributor

This seems to be in a if use_internet block:

        if use_internet:
            with working_directory(checkout_dir):
                result = os.system("git pull")

            if result != 0:
                request.config.cache.set("imageio_test_binaries", None)
>               raise RuntimeError(
                    "Cache directory is corrupt. Delete `.test_images` at project root."
                )
E               RuntimeError: Cache directory is corrupt. Delete `.test_images` at project root.

@wolfgangwalther
Copy link
Contributor

It's called like this:

pytest flags: -m pytest -m not\ \(needs_internet\)

Before it was called like this:

pytest flags: -m pytest -m not\ needs_internet

I think the parentheses are breaking this.

@Shawn8901
Copy link
Contributor

As the imageio package is still broken (due to obvious bad impl by upstream on the code block), what are the plans for that, Is already someone on that topic?
i stumbled over it while test building staging-next for my machines.

@philiptaron
Copy link
Contributor

philiptaron commented Jul 23, 2025

I'm actually doing it now. Couple more hours, I think.

qbisi added a commit to qbisi/nixpkgs that referenced this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python Python is a high-level, general-purpose programming language. 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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants