at 22.05-pre 1.5 kB view raw
1{ lib 2, buildPythonPackage 3, pytestCheckHook 4, cmake 5, scipy 6, scikit-learn 7, stdenv 8, xgboost 9, pandas 10, matplotlib 11, graphviz 12, datatable 13, hypothesis 14}: 15 16buildPythonPackage { 17 pname = "xgboost"; 18 inherit (xgboost) version src meta; 19 20 nativeBuildInputs = [ cmake ]; 21 buildInputs = [ xgboost ]; 22 propagatedBuildInputs = [ scipy ]; 23 checkInputs = [ 24 pytestCheckHook 25 scikit-learn 26 pandas 27 matplotlib 28 graphviz 29 datatable 30 hypothesis 31 ]; 32 33 # Override existing logic for locating libxgboost.so which is not appropriate for Nix 34 prePatch = let 35 libPath = "${xgboost}/lib/libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}"; 36 in '' 37 echo 'find_lib_path = lambda: ["${libPath}"]' > python-package/xgboost/libpath.py 38 ''; 39 40 dontUseCmakeConfigure = true; 41 42 postPatch = '' 43 cd python-package 44 ''; 45 46 preCheck = '' 47 ln -sf ../demo . 48 ln -s ${xgboost}/bin/xgboost ../xgboost 49 ''; 50 51 pytestFlagsArray = ["../tests/python"]; 52 disabledTestPaths = [ 53 # Requires internet access: https://github.com/dmlc/xgboost/blob/03cd087da180b7dff21bd8ef34997bf747016025/tests/python/test_ranking.py#L81 54 "../tests/python/test_ranking.py" 55 ]; 56 disabledTests = [ 57 "test_cli_binary_classification" 58 "test_model_compatibility" 59 ] ++ lib.optionals stdenv.isDarwin [ 60 # fails to connect to the com.apple.fonts daemon in sandboxed mode 61 "test_plotting" 62 "test_sklearn_plotting" 63 ]; 64 65 __darwinAllowLocalNetworking = true; 66}