python3Packages.chainer: fix build (#355898)

This commit is contained in:
Pol Dellaiera 2024-11-15 05:51:26 +01:00 committed by GitHub
commit c598fc0ca3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,18 +7,19 @@
fetchFromGitHub,
filelock,
mock,
numpy,
protobuf,
pytestCheckHook,
pythonOlder,
six,
setuptools,
numpy,
typing-extensions,
}:
buildPythonPackage rec {
pname = "chainer";
version = "7.8.1.post1";
format = "setuptools";
build-system = [ setuptools ];
disabled = pythonOlder "3.7";
@ -29,12 +30,18 @@ buildPythonPackage rec {
hash = "sha256-epwnExmyCWmwaOz+mJnAl1peEeHLBdQGC62BlLfSTQQ=";
};
propagatedBuildInputs = [
postPatch = ''
substituteInPlace chainer/_environment_check.py \
--replace-fail "import numpy.distutils.system_info" "import numpy" \
--replace-fail "numpy.distutils.system_info" "numpy.__config__.get_info"
'';
dependencies = [
filelock
numpy
protobuf
six
typing-extensions
numpy
] ++ lib.optionals cudaSupport [ cupy ];
nativeCheckInputs = [
@ -60,10 +67,10 @@ buildPythonPackage rec {
pythonImportsCheck = [ "chainer" ];
meta = with lib; {
meta = {
description = "Flexible framework of neural networks for deep learning";
homepage = "https://chainer.org/";
license = licenses.mit;
maintainers = with maintainers; [ hyphon81 ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ hyphon81 ];
};
}