nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, scikit-learn
6, scipy
7, pytest
8, isPy27
9}:
10
11buildPythonPackage rec {
12 pname = "bayesian-optimization";
13 version = "1.2.0";
14 disabled = isPy27;
15
16 src = fetchFromGitHub {
17 owner = "fmfn";
18 repo = "BayesianOptimization";
19 rev = version;
20 sha256 = "01mg9npiqh1qmq5ldnbpjmr8qkiw827msiv3crpkhbj4bdzasbfm";
21 };
22
23 propagatedBuildInputs = [
24 scikit-learn
25 scipy
26 ];
27
28 checkInputs = [ pytest ];
29 checkPhase = ''
30 # New sklearn broke one test: https://github.com/fmfn/BayesianOptimization/issues/243
31 pytest tests -k "not test_suggest_with_one_observation"
32 '';
33
34 meta = with lib; {
35 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
36 description = "A Python implementation of global optimization with gaussian processes";
37 homepage = "https://github.com/fmfn/BayesianOptimization";
38 license = licenses.mit;
39 maintainers = [ maintainers.juliendehos ];
40 };
41}