3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.xgboost: unbreak

- disable remaining tests as these now access network
- add pythonImportsCheck
- unbreaks package on Python 3.10 due to removing broken datatables checkInput
This commit is contained in:
Ben Darwin 2022-08-02 14:09:24 -04:00 committed by Rick van Schijndel
parent a6886cf9b3
commit 88c89e9a7f

View file

@ -1,34 +1,22 @@
{ lib
, buildPythonPackage
, pytestCheckHook
, pythonOlder
, cmake
, numpy
, scipy
, scikit-learn
, stdenv
, xgboost
, pandas
, matplotlib
, graphviz
, datatable
, hypothesis
}:
buildPythonPackage {
pname = "xgboost";
inherit (xgboost) version src meta;
disabled = pythonOlder "3.8";
nativeBuildInputs = [ cmake ];
buildInputs = [ xgboost ];
propagatedBuildInputs = [ scipy ];
checkInputs = [
pytestCheckHook
scikit-learn
pandas
matplotlib
graphviz
datatable
hypothesis
];
propagatedBuildInputs = [ numpy scipy ];
# Override existing logic for locating libxgboost.so which is not appropriate for Nix
prePatch = let
@ -43,24 +31,13 @@ buildPythonPackage {
cd python-package
'';
preCheck = ''
ln -sf ../demo .
ln -s ${xgboost}/bin/xgboost ../xgboost
'';
# test setup tries to download test data with no option to disable
# (removing sklearn from checkInputs causes all previously enabled tests to be skipped)
# and are extremely cpu intensive anyway
doCheck = false;
# tests are extremely cpu intensive, only run basic tests to ensure package is working
pytestFlagsArray = ["../tests/python/test_basic.py"];
disabledTestPaths = [
# Requires internet access: https://github.com/dmlc/xgboost/blob/03cd087da180b7dff21bd8ef34997bf747016025/tests/python/test_ranking.py#L81
"../tests/python/test_ranking.py"
];
disabledTests = [
"test_cli_binary_classification"
"test_model_compatibility"
] ++ lib.optionals stdenv.isDarwin [
# fails to connect to the com.apple.fonts daemon in sandboxed mode
"test_plotting"
"test_sklearn_plotting"
pythonImportsCheck = [
"xgboost"
];
__darwinAllowLocalNetworking = true;