python310Packages.ripser: fix build against c++, use pytestCheckHook

This commit is contained in:
Sandro Jäckel 2022-04-25 01:36:11 +02:00
parent 09450ad530
commit 9d99081d56
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -1,5 +1,6 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchpatch
, fetchPypi , fetchPypi
, pythonOlder , pythonOlder
, cython , cython
@ -7,7 +8,7 @@
, scipy , scipy
, scikit-learn , scikit-learn
, persim , persim
, pytest , pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -20,8 +21,11 @@ buildPythonPackage rec {
sha256 = "335112a0f94532ccbe686db7826ee8d0714b32f65891abf92c0a02f3cb0fc5fd"; sha256 = "335112a0f94532ccbe686db7826ee8d0714b32f65891abf92c0a02f3cb0fc5fd";
}; };
checkInputs = [ patches = [
pytest (fetchpatch {
url = "https://github.com/scikit-tda/ripser.py/commit/4baa248994cee9a65d710fac91809bad8ed4e5f1.patch";
sha256 = "sha256-J/nxMOGOUiBueojJrUlAaXwktHDploYG/XL8/siF2kY=";
})
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -32,13 +36,15 @@ buildPythonPackage rec {
persim persim
]; ];
checkPhase = '' checkInputs = [
pytestCheckHook
];
preCheck = ''
# specifically needed for darwin # specifically needed for darwin
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
mkdir -p $HOME/.matplotlib mkdir -p $HOME/.matplotlib
echo "backend: ps" > $HOME/.matplotlib/matplotlibrc echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
pytest
''; '';
meta = with lib; { meta = with lib; {