xgboost: 0.90 -> 1.4.1

This commit is contained in:
Robert T. McGibbon
2021-05-13 13:48:35 -07:00
committed by Jonathan Ringer
parent e604994fc4
commit cb21e3d5e4
3 changed files with 68 additions and 68 deletions
@@ -1,6 +1,6 @@
{ buildPythonPackage
, pytest
, nose
, pytestCheckHook
, cmake
, scipy
, scikitlearn
, stdenv
@@ -10,28 +10,52 @@
, matplotlib
, graphviz
, datatable
, hypothesis
}:
buildPythonPackage {
pname = "xgboost";
inherit (xgboost) version src meta;
patches = [
(substituteAll {
src = ./lib-path-for-python.patch;
libpath = "${xgboost}/lib";
extention = stdenv.hostPlatform.extensions.sharedLibrary;
})
nativeBuildInputs = [ cmake ];
buildInputs = [ xgboost ];
propagatedBuildInputs = [ scipy ];
checkInputs = [
pytestCheckHook
scikitlearn
pandas
matplotlib
graphviz
datatable
hypothesis
];
postPatch = "cd python-package";
propagatedBuildInputs = [ scipy ];
buildInputs = [ xgboost ];
checkInputs = [ nose pytest scikitlearn pandas matplotlib graphviz datatable ];
checkPhase = ''
ln -sf ../demo .
nosetests ../tests/python
# Override existing logic for locating libxgboost.so which is not appropriate for Nix
prePatch = let
libPath = "${xgboost}/lib/libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}";
in ''
echo 'find_lib_path = lambda: ["${libPath}"]' > python-package/xgboost/libpath.py
'';
dontUseCmakeConfigure = true;
postPatch = ''
cd python-package
'';
preCheck = ''
ln -sf ../demo .
ln -s ${xgboost}/bin/xgboost ../xgboost
'';
pytestFlagsArray = ["../tests/python"];
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"
];
}