I’m working on packaging jax at the moment and according to the nix docs I should be using something like
checkInputs = [ pytest ];
checkPhase = "pytest tests/";
And this makes sense since the jax docs explain they use pytest as well.
But when I build the derivation, I get:
...
Installing collected packages: jax
Successfully installed jax-0.2.19
/private/tmp/nix-build-python3.9-jax-0.2.19.drv-0/jax-0.2.19
Finished executing pipInstallPhase
post-installation fixup
strip is /nix/store/a2ry0yj3mav03l2fl6pkr3a2qhficyw7-cctools-binutils-darwin-949.0.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/2s0kpkv2p8k601g38v466bhf0lnh71jz-python3.9-jax-0.2.19/lib
patching script interpreter paths in /nix/store/2s0kpkv2p8k601g38v466bhf0lnh71jz-python3.9-jax-0.2.19
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
running install tests
============================= test session starts ==============================
platform darwin -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /private/tmp/nix-build-python3.9-jax-0.2.19.drv-0/jax-0.2.19
collected 0 items
============================ no tests ran in 0.01s =============================
ERROR: file or directory not found: tests/
What’s going on here? Shouldn’t the pythonRemoveTestsDir
hook only be run after the checkPhase
? How else do I run tests?