1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 deap,
7 numpy,
8 scikit-learn,
9 scipy,
10 unittestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "sklearn-deap";
15 version = "0.3.0";
16 format = "setuptools";
17
18 # No tests in Pypi
19 src = fetchFromGitHub {
20 owner = "rsteca";
21 repo = "sklearn-deap";
22 rev = version;
23 hash = "sha256-bXBHlv1pIOyDLKCBeffyHaTZ7gNiZNl0soa73e8E4/M=";
24 };
25
26 patches = [
27 # Fix for scikit-learn v1.1. See: https://github.com/rsteca/sklearn-deap/pull/80
28 (fetchpatch {
29 url = "https://github.com/rsteca/sklearn-deap/commit/3b84bd905796378dd845f99e083da17284c9ff6f.patch";
30 hash = "sha256-YYLw0uzecyIbdNAy/CxxWDV67zJbZZhUMypnDm/zNGs=";
31 })
32 (fetchpatch {
33 url = "https://github.com/rsteca/sklearn-deap/commit/2f60e215c834f60966b4e51df25e91939a72b952.patch";
34 hash = "sha256-vn5nLPwwkjsQrp3q7C7Z230lkgRiyJN0TQxO8Apizg8=";
35 })
36 ];
37
38 propagatedBuildInputs = [
39 numpy
40 scipy
41 deap
42 scikit-learn
43 ];
44
45 nativeCheckInputs = [ unittestCheckHook ];
46
47 pythonImportsCheck = [ "evolutionary_search" ];
48
49 meta = with lib; {
50 description = "Use evolutionary algorithms instead of gridsearch in scikit-learn";
51 homepage = "https://github.com/rsteca/sklearn-deap";
52 license = licenses.mit;
53 maintainers = with maintainers; [ psyanticy ];
54 broken = true; # incompatible with scikit-learn >= 1.6
55 };
56}