Skip to content
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

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

Merged
merged 1 commit into from Apr 26, 2020

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.

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants