1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7 pytestCheckHook,
8 setuptools,
9 numpy,
10 scipy,
11 six,
12 paramz,
13 matplotlib,
14 cython,
15}:
16
17buildPythonPackage rec {
18 pname = "gpy";
19 version = "1.13.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "SheffieldML";
26 repo = "GPy";
27 tag = "v${version}";
28 hash = "sha256-kggXePDKJcgw8qwLIBTxbwhiLw2H4dkx7082FguKP0Y=";
29 };
30
31 pythonRelaxDeps = [
32 "paramz"
33 "scipy"
34 ];
35
36 nativeBuildInputs = [ setuptools ];
37 buildInputs = [ cython ];
38 propagatedBuildInputs = [
39 numpy
40 scipy
41 six
42 paramz
43 matplotlib
44 ];
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 # Rebuild cython-generated .c files to ensure compatibility
48 preBuild = ''
49 for fn in $(find . -name '*.pyx'); do
50 echo $fn | sed 's/\.\.pyx$/\.c/' | xargs ${cython}/bin/cython -3
51 done
52 '';
53
54 disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
55 # Rounding difference break comparison
56 "TestGradientMultiOutputGPModel"
57 ];
58
59 pythonImportsCheck = [ "GPy" ];
60
61 meta = with lib; {
62 description = "Gaussian process framework in Python";
63 homepage = "https://sheffieldml.github.io/GPy";
64 changelog = "https://github.com/SheffieldML/GPy/releases/tag/v${version}";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ bcdarwin ];
67 };
68}