buildPythonPackage, buildPythonApplication: support __structuredAttrs = true#347194
Conversation
f3bee93 to
46f8c8a
Compare
|
Questions: When passing
|
|
Thanks for working on this! I intend to review this PR, but will not have much time the next two weeks. |
46f8c8a to
38943f3
Compare
wolfgangwalther
left a comment
There was a problem hiding this comment.
This is not a full review, but it should be enough for a first iteration.
Most importantly I have not touched the question on how to deal with the compatibility things, yet, aside from giving a few more generic thoughts on the matter.
Maybe we can split some of the uncontroversial changes off (everything independent of compatHelpers) and merge separately?
01ac9f7 to
ae62db1
Compare
There used to be a lot of
When We should not rely on such implementation detail of |
Thank you for reviewing!
I'll split the easier part into another PR after we reach a consensus about how to add elements to |
I wasn't aware of that PR. I see that doing the same for the last remaining |
Oops! My bad.
I'll gather them into the same commit. Update: Applied. |
21c6d04 to
9f8fa39
Compare
wolfgangwalther
left a comment
There was a problem hiding this comment.
I did the following:
- went through the PR line-by-line, except for a few nits the changes LGTM.
- found no remaining uses of
pytestFlagsArrayorunittestFlagsArrayin doc/*. - found no other
setupPyGlobalFlagsorsetupPyBuildFlagsdepending on bash eval or passing spaces. - build some random python packages to confirm nothing is obviously broken.
|
FTR: I built conda and tensorflow successfully on x86_64-linux, when applying this set of patches on master. Let's fix the nits / docs / merge-conflict and merge this, I'd say. |
|
Thank you both for reviewing! I'll address them next week (after the final exam of my uni). |
|
Good luck with exams! |
Add flag pytestFlags as the new, conforming interface replacing pytestFlagsArray. Stop Bash-expanding disabledTests and disabledTestPaths. Handle disabledTestPaths with `pytest --ignore-glob <path>` to keep globbing support. Check if each path glob matches at least one path using the `glob` module from the Python standard library. Also make buildPythonPackage and buildPythonApplication stop escaping the elements of disabledTests and disabledTestPaths.
Handle flags with appendToVar and concatTo. Stop Bash-expanding elements of setupPyGlobalFlags and setupPyBuildFlags.
…ithout expecting Bash expansion
…expanding expection
…stically Take unittestFlags as the new and conforming interface. Keep unittestFlagsArray as is.
66cf078 to
625cf90
Compare
|
Addressed the review suggestions and rebased! |
|
Now we can start migrating pytestFlagsArray to pytestFlags. I'll add a TODO in the tracking issue |
This PR refactors the setup hooks and
wrap.shthat construct the two build helpers, makingbuildPythonPackageandbuildPythonApplicationsupport both__structuredAttrs = trueandstructuredAttrs = false.The representation of the flags attributes as shell/environment variables for most Python building setup hooks are now the same as
stdenv.mkDerivationand other build helpers -- they are space-separated environment variables when__structuredAttrs = falseand Bash arrays when__structuredAttrs = true, and are concatenated to the command without Bash-evaluation. The following behaviour changes are introduced during the conversion:The following flags are no longer Bash-expanded before concatenated to the command:
disabledTestsanddisabledTestPathsforpytestCheckHook. (disabledTestPathsused to be expanded twice before concatenation.)setupPyBuildFlagsandsetupPyGlobalFlagsforsetuptoolsBuildHook.pytestFlagsandunittestFlagsreplacespytestFlagsArrayandunittestFlagsArrayand become the new and conforming interface.pytestFlagsArrayandunittestFlagsArrayare kept for compatibility purposes. They continue to be Bash-expanded before concatenated. Such compatibility layer would get removed in future releases.Almost all the refactored scripts are linted with ShellCheck, except
wrap.sh, which I don't know how to lint correctly.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.