summaryrefslogtreecommitdiffstats
path: root/pkgs/development
diff options
context:
space:
mode:
authorJonas Heinrich <onny@project-insanity.org>2022-09-06 19:38:23 +0200
committerGitHub <noreply@github.com>2022-09-06 14:38:23 -0300
commitee85c13df19438a55fc1be1f93b7bce7a309ca8b (patch)
treef7099c185453c4e291af8aad8264d72f2626c053 /pkgs/development
parentcef96d8cbde5b0ec736a9f597aaffe50a6de7a53 (diff)
python310Packages.bayesian-optimization: Fix broken tests (#181205)
* python310Packages.bayesian-optimization: Fix tests * python310Packages.bayesian-optimization: add pythonImportsCheck Co-authored-by: superherointj <5861043+superherointj@users.noreply.github.com>
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/bayesian-optimization/default.nix31
1 files changed, 24 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/bayesian-optimization/default.nix b/pkgs/development/python-modules/bayesian-optimization/default.nix
index ec27aa5e37ae..03ac94ad6044 100644
--- a/pkgs/development/python-modules/bayesian-optimization/default.nix
+++ b/pkgs/development/python-modules/bayesian-optimization/default.nix
@@ -4,8 +4,9 @@
, fetchFromGitHub
, scikit-learn
, scipy
-, pytest
+, pytestCheckHook
, isPy27
+, fetchpatch
}:
buildPythonPackage rec {
@@ -25,15 +26,31 @@ buildPythonPackage rec {
scipy
];
- checkInputs = [ pytest ];
- checkPhase = ''
- # New sklearn broke one test: https://github.com/fmfn/BayesianOptimization/issues/243
- pytest tests -k "not test_suggest_with_one_observation"
- '';
+ patches = [
+ # TypeError with scipy >= 1.8
+ # https://github.com/fmfn/BayesianOptimization/issues/300
+ (fetchpatch {
+ url = "https://github.com/fmfn/BayesianOptimization/commit/b4e09a25842985a4a0acea0c0f5c8789b7be125e.patch";
+ sha256 = "sha256-PfcifCFd4GRNTA+4+T+6A760QAgyZxhDCTyzNn2crdM=";
+ name = "scipy_18_fix.patch";
+ })
+ ];
+
+ checkInputs = [ pytestCheckHook ];
+
+ disabledTests = [
+ # New sklearn broke one test
+ # https://github.com/fmfn/BayesianOptimization/issues/243
+ "test_suggest_with_one_observation"
+ ];
+
+ pythonImportsCheck = [ "bayes_opt" ];
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
- description = "A Python implementation of global optimization with gaussian processes";
+ description = ''
+ A Python implementation of global optimization with gaussian processes
+ '';
homepage = "https://github.com/fmfn/BayesianOptimization";
license = licenses.mit;
maintainers = [ maintainers.juliendehos ];