Skip to content

docs/python: document builders using doInstallCheck and not doCheck#86051

Merged
zimbatm merged 1 commit intoNixOS:masterfrom
doronbehar:doc-python-doInstallCheck
Apr 26, 2020
Merged

docs/python: document builders using doInstallCheck and not doCheck#86051
zimbatm merged 1 commit intoNixOS:masterfrom
doronbehar:doc-python-doInstallCheck

Conversation

@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Apr 26, 2020

Motivation for this change

When trying to disable failing tests of a package via an override, it took me so long to realize this, so I think it should at least be documented. Source code reference:

# Python packages don't have a checkPhase, only an installCheckPhase
doCheck = false;
doInstallCheck = attrs.doCheck or true;

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@doronbehar doronbehar requested a review from FRidh as a code owner April 26, 2020 10:51
@ofborg ofborg bot added 8.has: documentation This PR adds or changes documentation 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 Apr 26, 2020
@zimbatm zimbatm merged commit 3581287 into NixOS:master Apr 26, 2020
@FRidh
Copy link
Member

FRidh commented Apr 26, 2020

This is not correct. It says right there that it picks up attrs.doCheck. Let me guess, you used .overrideAttrs?

@doronbehar
Copy link
Contributor Author

Yes. (How else can I do that 🤔).

@FRidh
Copy link
Member

FRidh commented Apr 26, 2020

15.17.2.2.1.2. Overriding Python packages

@doronbehar
Copy link
Contributor Author

Oh I was supposed to use overridePythonAttrs?

@doronbehar
Copy link
Contributor Author

The fact python derivations has their own overrideAttrs method is totally new to me. Perhaps this should be present in the FAQ as well. Besides, in the examples of the very same document, overrideAttrs is used:

zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
src = super.fetchgit {
url = "https://github.com/sametmax/0bin";
rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
};

FRidh added a commit that referenced this pull request Apr 26, 2020
…oCheck (#86051)"

For disabling tests when overriding, use `.overridePythonAttrs`.

Discussion about aliasing `.overridePythonAttrs` to `.overrideAttrs`.
#82772

This reverts commit 3581287.
@FRidh
Copy link
Member

FRidh commented Apr 26, 2020

reverted in ca2fd28. Please have a look at the commit text.

@doronbehar doronbehar deleted the doc-python-doInstallCheck branch March 2, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: documentation This PR adds or changes documentation 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