python3Packages.scikit-learn: enable parallel building and testing

This commit is contained in:
DavHau 2021-05-15 15:14:01 +07:00
parent cd8f3e6c44
commit 0a1a14d13e

View File

@ -7,7 +7,8 @@
, glibcLocales
, numpy
, scipy
, pytest
, pytestCheckHook
, pytest-xdist
, pillow
, cython
, joblib
@ -54,17 +55,30 @@ buildPythonPackage rec {
joblib
threadpoolctl
];
checkInputs = [ pytest ];
checkInputs = [ pytestCheckHook pytest-xdist ];
LC_ALL="en_US.UTF-8";
doCheck = !stdenv.isAarch64;
# Skip test_feature_importance_regression - does web fetch
checkPhase = ''
cd $TMPDIR
HOME=$TMPDIR OMP_NUM_THREADS=1 pytest -k "not test_feature_importance_regression" --pyargs sklearn
preBuild = ''
export SKLEARN_BUILD_PARALLEL=$NIX_BUILD_CORES
'';
doCheck = !stdenv.isAarch64;
# Skip test_feature_importance_regression - does web fetch
disabledTests = [ "test_feature_importance_regression" ];
pytestFlagsArray = [ "-n" "$NIX_BUILD_CORES" "--pyargs" "sklearn" ];
preCheck = ''
cd $TMPDIR
export HOME=$TMPDIR
export OMP_NUM_THREADS=1
'';
pythonImportsCheck = [ "sklearn" ];
meta = with lib; {
description = "A set of python modules for machine learning and data mining";
changelog = let