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.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 # 1.13.0 not on PyPI yet
25 src = fetchFromGitHub {
26 owner = "SheffieldML";
27 repo = "GPy";
28 rev = "refs/tags/v.${version}";
29 hash = "sha256-2HKKKBD/JFSeLQGvvgObxqxv9IHEKFnpaejdKbYZbmY=";
30 };
31
32 nativeBuildInputs = [ setuptools ];
33 buildInputs = [ cython ];
34 propagatedBuildInputs = [
35 numpy
36 scipy
37 six
38 paramz
39 matplotlib
40 ];
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 # Rebuild cython-generated .c files to ensure compatibility
44 preBuild = ''
45 for fn in $(find . -name '*.pyx'); do
46 echo $fn | sed 's/\.\.pyx$/\.c/' | xargs ${cython}/bin/cython -3
47 done
48 '';
49
50 pythonImportsCheck = [ "GPy" ];
51
52 meta = with lib; {
53 description = "Gaussian process framework in Python";
54 homepage = "https://sheffieldml.github.io/GPy";
55 changelog = "https://github.com/SheffieldML/GPy/releases/tag/v.${version}";
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ bcdarwin ];
58 broken = stdenv.isDarwin; # See inscrutable error message here: https://github.com/NixOS/nixpkgs/pull/107653#issuecomment-751527547
59 };
60}