From 4852068c580c8008576a35c32134b2b4b18b7eab Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 26 Nov 2024 03:34:53 +0000 Subject: [PATCH 1/2] python312Packages.scikit-survival: use github src; fix build Pypi source https://pypi.org/project/scikit-survival/) fails to download tho (scikit_survival) works. Switch to github source. Build wants an eigen submodule but just needs the include files so create a symlink to the package relax deps for scikit-learn and numpy --- .../python-modules/scikit-survival/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/scikit-survival/default.nix b/pkgs/development/python-modules/scikit-survival/default.nix index 85539eabeff6..b60546d8cc84 100644 --- a/pkgs/development/python-modules/scikit-survival/default.nix +++ b/pkgs/development/python-modules/scikit-survival/default.nix @@ -2,9 +2,10 @@ stdenv, lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, cython, ecos, + eigen, joblib, numexpr, numpy, @@ -21,9 +22,11 @@ buildPythonPackage rec { version = "0.23.0"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-JFI3SDOK74vQdoUOStYlc4e0VHps97KjV3a1NQSN6E0="; + src = fetchFromGitHub { + owner = "sebp"; + repo = "scikit-survival"; + rev = "refs/tags/v${version}"; + hash = "sha256-/gHfCZH9VjE5UQ8LWoBNd8xCMln4r9Etq/eCx/F8w7A="; }; nativeBuildInputs = [ @@ -46,9 +49,12 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - # treat numpy versions as lower bounds, same as setuptools build + # can remove scikit-learn after 0.23.1 postPatch = '' - sed -i 's/numpy==/numpy>=/' pyproject.toml + ln -s ${lib.getInclude eigen}/include/eigen3/Eigen \ + sksurv/linear_model/src/eigen + sed -i -e 's/numpy>=2.0.0/numpy/' \ + -e 's/scikit-learn~=1.4.0/scikit-learn/' pyproject.toml ''; # Hack needed to make pytest + cython work From c8e9bfe9e94f3276dc193b2bb3739e47d3dbd20c Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 26 Nov 2024 03:40:54 +0000 Subject: [PATCH 2/2] python312Packages.scikit-survival: 0.23.0 -> 0.23.1 https://github.com/sebp/scikit-survival/releases/tag/v0.23.1 --- pkgs/development/python-modules/scikit-survival/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/scikit-survival/default.nix b/pkgs/development/python-modules/scikit-survival/default.nix index b60546d8cc84..eb7035189644 100644 --- a/pkgs/development/python-modules/scikit-survival/default.nix +++ b/pkgs/development/python-modules/scikit-survival/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "scikit-survival"; - version = "0.23.0"; + version = "0.23.1"; pyproject = true; src = fetchFromGitHub { owner = "sebp"; repo = "scikit-survival"; rev = "refs/tags/v${version}"; - hash = "sha256-/gHfCZH9VjE5UQ8LWoBNd8xCMln4r9Etq/eCx/F8w7A="; + hash = "sha256-6902chXALa73/kTJ5UwV4CrB7/7wn+QXKpp2ej/Dnk8="; }; nativeBuildInputs = [