buildPython*: pass check-related args whenever specified#376060
buildPython*: pass check-related args whenever specified#376060mweinelt merged 1 commit intoNixOS:stagingfrom
Conversation
|
Any idea why it was done the way it was done before? |
The I doubt guarding the flags this way would be as effective as intended, as neither |
|
To achieve the effect, wouldn't we need to guard this on Edit: Ah, #272177 wasn't even merged. So it seems like the guards will only be useful once that's done, right? |
The original PR was an initial effort for #272177, but it was unfortunately closed due to author burnout. It is more practical to re-work the guard if someone wants to pick up the automatic-passthru-test work. |
I think so. |
|
|
Some Python packages, especially scientific ones, have expensive tests.
In python packages, However, I do not intend to prevent our ideals with these hacks, so I believe we could remove it if necessary. |
I understand this as we add such guards as a shorthand to "move" the attributes to If so, why do people not just define the check-related attributes under the package test definition (e.g., the |
Yes, absolutely.
I guess they didn't think to guard the flags, because it was also a known hack to avoid circular imports. |
This means we must transit all the packages currently using such a hack before merging this PR to avoid breakage. |
|
As the tree-wide transition is unavoidable (even if the total number of affected packages is not necessarily large), I would prefer resuming (re-implementing) #272177 before the migration to make the effort more meaningful. As for the Here's a worked prototype: staging...ShamrockLee:build-python-passthru-check
@natsukium @wolfgangwalther Do you think this is a good idea, or should we proceed with the transition directly? |
Performing checks separately avoids circular dependency for test cases, but how does it related to guarding the flags? The flags are mostly plain strings, and has no effect when In addition, if the flags cause circular dependency, the evaluation would fail. If the evaluation work, it should be safe to merge this PR. |
ed926ea to
8b87a19
Compare
|
These packages, found with the following find pkgs/development/python-modules -type f -name "*.nix" \
-exec grep -q "doCheck = false" {} \; \
-exec grep -q "\([Cc]ircular\|[Cc]yclic\)" {} \; \
-exec grep -q '\(disabledTest\|pytestFlags\|unittestFlags\)' {} \; \
-print@ofborg build python3Packages.pygments |
8b87a19 to
90c4e30
Compare
|
@wolfgangwalther, are you still approving this change? |
Pass - disabledTestMarks - disabledTestPaths - disabledTests - enabledTestMarks - enabledTestPaths - enabledTests - pytestFlags - pytestFlagsArray - unittestFlags - unittestFlagsArray whenever they are specified, no matter if doCheck is true or if they are empty lists. Simplify the buildPython* argument handling and bring us closer to the deprecation of overridePythonAttrs and the adoption of fixed-point arguments.
90c4e30 to
67564e0
Compare
|
Thanks for working on these things! |
|
@mweinelt Thank you for reviewing and merging! Could you also help take a look at other PRs on the tracking issue especially |
Pass
disabledTestMarksdisabledTestPathsdisabledTestsenabledTestMarksenabledTestPathsenabledTestspytestFlagspytestFlagsArrayunittestFlagsunittestFlagsArraywhenever they are specified,
no matter if doCheck is true or if they are empty lists.
This PR simplifies the buildPython* argument handling and brings us closer to deprecating
overridePythonAttrsand adopting fixed-point arguments.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.