Skip to content

Commit

Permalink
wip: include the necessary scikit-learn patch
Browse files Browse the repository at this point in the history
Not working yet, the patch does not take effect on the poetry package
and mixing poetry & nixpkgs packages causes all sorts of issues.
  • Loading branch information
timokau committed Sep 30, 2020
1 parent bd5c46f commit 4901119
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
, pkgs ? import pkgsPath {}
}:
let
python = pkgs.python37;
pythonEnv = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
# For tensorflow 1.15 https://github.com/nix-community/poetry2nix/issues/180
python = pkgs.python37;
python = python;
overrides = pkgs.poetry2nix.overrides.withDefaults (self: super: {
# https://github.com/nix-community/poetry2nix/issues/166
sphinx-rtd-theme = super.sphinx_rtd_theme;
Expand All @@ -21,11 +22,44 @@ let
buildInputs = with pkgs; [ xorg.libX11 ] ++ old.buildInputs;
}
);
# scikit-learn = super.scikitlearn.overridePythonAttrs (
scikit-learn = python.pkgs.scikitlearn.overridePythonAttrs (
old: {
# src = pkgs.fetchFromGitHub {
# owner = "scikit-learn";
# repo = "scikit-learn";
# rev = "21121f50997dba43fffbfecb2f672431cf708363"; # master 2020-09-30
# sha256 = "1lqlww0i4w2g4lb6ir9mnsmsnp5zga70r77j4qa9mflvxbmr4c97";
# };
# scikit-optimize
# Backport of https://github.com/scikit-learn/scikit-learn/pull/17936
# to make the estimator checks work for our case.
# patches = [./0001-Relax-init-parameter-type-checks.patch];
patches = [./0001-Relax-init-parameter-type-checks.patch];
# doCheck = false; # slow
# postPatch = ''
# cat sklearn/utils/estimator_checks.py
# rm -r *
# '';
}
);
numpy = python.pkgs.numpy;
joblib = python.pkgs.joblib;
# scikit-optimize = super.scikit-optimize.overridePythonAttrs (
# old: {
# # src = pkgs.fetchFromGitHub {
# # owner = "scikit-optimize";
# # repo = "scikit-optimize";
# # rev = "v0.8.1";
# # sha256 = "1bz8gxccx8n99abw49j8h5zf3i568g5hcf8nz1yinma8jqhxjkjh";
# # };
# }
# );
});
};
in pkgs.mkShell {
buildInputs = [
pythonEnv
pkgs.python37.pkgs.poetry
python.pkgs.poetry
];
}

0 comments on commit 4901119

Please sign in to comment.