Hello
Sorry if this may be an obvious question but I’m still new with nix.
I’m trying to build a python package with nix, uproot, using its expression from nixpkgs.
The package uses pytest in the check phase.
One of the tests requires the package “ROOT” (to test against the original implementation), but since uproot itself does not require it, it’s a non mandatory test, using importorskip.
Uproot builds fine, but when reaching the check phase it fails due to the ROOT test being skipped.
1 - Make a package for ROOT and add it to checkInputs in your uproot package
2 - Disable the failing tests in uproot. The way do this depends on how the tests are implemented in that package. Alternatively, you may disable all the tests in uproot by adding doCheck = false to your package.
Building ROOT is not ideal because ROOT takes a while (hours) to build, which is probably why it is not an input in nixpkgs.
I think I can try using an overlay to override the doCheck attribute.
I asked because I was using uproot from nixpkgs and I feared I was doing something wrong.
Is it normal for a derivation to fail because of a skipped test or is it something about my configuration that makes it so?
Unfortunately this happens a lot, especially in the python ecosystem, where a maintainer will leave off dependencies for their tests. I usually just disable the tests if they’re missing dependencies not defined in the package’s setup.py.
To answer your original question, you can checkout nixpkgs from a certain commit (like the current master), then pull out the package that you need and add it to an overlay.
I don’t think we need to add ROOT for uproot tests. The input root files for reading are already generated and saved in the repo: uproot3/tests/samples at master · scikit-hep/uproot3 · GitHub
Perhaps in the future, once they implement writing files, it would need ROOT to validate the output.
No we don’t. But two of the tests were failing because they tried to fetch files from the network which is disallowed in (sandboxed) builds. That’s why those two are now disabled and the rest successfully run through.