nixpkgs/pkgs/development/python-modules/sklearn-deap/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

37 lines
1.0 KiB
Nix

{ lib, stdenv, buildPythonPackage, fetchFromGitHub, fetchpatch, numpy, scipy, deap, scikitlearn, python }:
buildPythonPackage rec {
pname = "sklearn-deap";
version = "0.2.3";
# No tests in Pypi
src = fetchFromGitHub {
owner = "rsteca";
repo = pname;
rev = version;
sha256 = "1yqnmy8h08i2y6bb2s0a5nx9cwvyg45293whqh420c195gpzg1x3";
};
patches = [
# Fix for newer versions of scikit-learn. See: https://github.com/rsteca/sklearn-deap/pull/62
(fetchpatch {
url = "https://github.com/rsteca/sklearn-deap/commit/3ae62990fc87f36b59382e7c4db3c74cf99ec3bf.patch";
sha256 = "1na6wf4v0dcmyz3pz8aiqkmv76d1iz3hi4iyfq9kfnycgzpv1kxk";
})
];
propagatedBuildInputs = [ numpy scipy deap scikitlearn ];
checkPhase = ''
${python.interpreter} test.py
'';
meta = with lib; {
description = "Use evolutionary algorithms instead of gridsearch in scikit-learn";
homepage = "https://github.com/rsteca/sklearn-deap";
license = licenses.lgpl3;
maintainers = with maintainers; [ psyanticy ];
};
}