lol

Merge pull request #122207 from rmcgibbo/mlrose

python3Packages.mlrose: fix build

authored by

Pavol Rusnak and committed by
GitHub
cf395160 d3ed0f50

+29 -5
+29 -5
pkgs/development/python-modules/mlrose/default.nix
··· 1 - { lib, isPy27, buildPythonPackage, fetchPypi, scikitlearn }: 1 + { lib 2 + , isPy27 3 + , buildPythonPackage 4 + , fetchFromGitHub 5 + , fetchpatch 6 + , scikitlearn 7 + , pytestCheckHook 8 + , pytest-randomly 9 + }: 2 10 3 11 buildPythonPackage rec { 4 12 pname = "mlrose"; 5 13 version = "1.3.0"; 6 14 disabled = isPy27; 7 15 8 - src = fetchPypi { 9 - inherit pname version; 10 - sha256 = "cec83253bf6da67a7fb32b2c9ae13e9dbc6cfbcaae2aa3107993e69e9788f15e"; 16 + src = fetchFromGitHub { 17 + owner = "gkhayes"; 18 + repo = "mlrose"; 19 + rev = "v${version}"; 20 + sha256 = "1dn43k3rcypj58ymcj849b37w66jz7fphw8842v6mlbij3x0rxfl"; 11 21 }; 22 + 23 + patches = [ 24 + # Fixes compatibility with scikit-learn 0.24.1 25 + (fetchpatch { 26 + url = "https://github.com/gkhayes/mlrose/pull/55/commits/19caf8616fc194402678aa67917db334ad02852a.patch"; 27 + sha256 = "1nivz3bn21nd21bxbcl16a6jmy7y5j8ilz90cjmd0xq4v7flsahf"; 28 + }) 29 + ]; 12 30 13 31 propagatedBuildInputs = [ scikitlearn ]; 32 + checkInputs = [ pytest-randomly pytestCheckHook ]; 14 33 15 34 postPatch = '' 16 - sed -i 's,sklearn,scikit-learn,g' setup.py 35 + substituteInPlace setup.py --replace sklearn scikit-learn 17 36 ''; 37 + 38 + pythonImportsCheck = [ "mlrose" ]; 39 + 40 + # Fix random seed during tests 41 + pytestFlagsArray = [ "--randomly-seed 0" ]; 18 42 19 43 meta = with lib; { 20 44 description = "Machine Learning, Randomized Optimization and SEarch";