1{ lib, stdenv
2, buildPythonPackage
3, fetchPypi
4, numpy
5, scipy
6, six
7, paramz
8, matplotlib
9, cython
10, nose
11}:
12
13buildPythonPackage rec {
14 pname = "GPy";
15 version = "1.10.0";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "a2b793ef8d0ac71739e7ba1c203bc8a5afa191058b42caa617e0e29aa52aa6fb";
20 };
21
22 buildInputs = [ cython ];
23 propagatedBuildInputs = [ numpy scipy six paramz matplotlib ];
24 nativeCheckInputs = [ nose ];
25
26 # $ nosetests GPy/testing/*.py
27 # => Ran 483 tests in 112.146s (on 8 cores)
28 # So instead, run shorter set of tests
29 checkPhase = ''
30 nosetests GPy/testing/linalg_test.py
31 '';
32
33 # Rebuild cython-generated .c files since the included
34 # ones were built with an older version of cython that is
35 # incompatible with python3.9
36 preBuild = ''
37 for fn in $(find . -name '*.pyx'); do
38 echo $fn | sed 's/\.\.pyx$/\.c/' | xargs ${cython}/bin/cython -3
39 done
40 '';
41
42 pythonImportsCheck = [
43 "GPy"
44 ];
45
46 meta = with lib; {
47 description = "Gaussian process framework in Python";
48 homepage = "https://sheffieldml.github.io/GPy";
49 license = licenses.bsd3;
50 maintainers = with maintainers; [ bcdarwin ];
51 broken = stdenv.isDarwin; # See inscrutable error message here: https://github.com/NixOS/nixpkgs/pull/107653#issuecomment-751527547
52 };
53}