1{ lib, stdenv
2, buildPythonPackage
3, fetchPypi
4, cmake
5, numpy
6, scipy
7, scikit-learn
8, llvmPackages ? null
9}:
10
11buildPythonPackage rec {
12 pname = "lightgbm";
13 version = "3.3.2";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "5d25d16e77c844c297ece2044df57651139bc3c8ad8c4108916374267ac68b64";
18 };
19
20 nativeBuildInputs = [
21 cmake
22 ];
23
24 dontUseCmakeConfigure = true;
25
26 buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
27 propagatedBuildInputs = [
28 numpy
29 scipy
30 scikit-learn
31 ];
32
33 postConfigure = ''
34 export HOME=$(mktemp -d)
35 '';
36
37 # The pypi package doesn't distribute the tests from the GitHub
38 # repository. It contains c++ tests which don't seem to wired up to
39 # `make check`.
40 doCheck = false;
41 pythonImportsCheck = [ "lightgbm" ];
42
43 meta = with lib; {
44 description = "A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART) framework";
45 homepage = "https://github.com/Microsoft/LightGBM";
46 license = licenses.mit;
47 maintainers = with maintainers; [ teh costrouc ];
48 };
49}