python3Packages.scikit-survival: fix and update (#359183)

This commit is contained in:
Weijia Wang 2024-11-27 22:21:41 +01:00 committed by GitHub
commit 1cd3957e37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,10 @@
stdenv, stdenv,
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchPypi, fetchFromGitHub,
cython, cython,
ecos, ecos,
eigen,
joblib, joblib,
numexpr, numexpr,
numpy, numpy,
@ -18,12 +19,14 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "scikit-survival"; pname = "scikit-survival";
version = "0.23.0"; version = "0.23.1";
pyproject = true; pyproject = true;
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "sebp";
hash = "sha256-JFI3SDOK74vQdoUOStYlc4e0VHps97KjV3a1NQSN6E0="; repo = "scikit-survival";
rev = "refs/tags/v${version}";
hash = "sha256-6902chXALa73/kTJ5UwV4CrB7/7wn+QXKpp2ej/Dnk8=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -46,9 +49,12 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ]; nativeCheckInputs = [ pytestCheckHook ];
# treat numpy versions as lower bounds, same as setuptools build # can remove scikit-learn after 0.23.1
postPatch = '' 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 # Hack needed to make pytest + cython work