python3Packages.grad-cam: fix build

Assisted-by: Pi (gpt-6.1-sol)
This commit is contained in:
Ben Siraphob
2026-10-28 17:18:14 -04:00
parent 2fa979f31f
commit a4a817cc86

View File

@@ -1,11 +1,11 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
setuptools,
matplotlib,
numpy,
opencv-python,
opencv-python-headless,
pillow,
scikit-learn,
torch,
@@ -19,11 +19,19 @@ buildPythonPackage rec {
version = "1.5.7";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-9r4G+CZnei6SLDh535vjlEsUppZD2A577Jrfsm9rXkI=";
src = fetchFromGitHub {
owner = "jacobgil";
repo = "pytorch-grad-cam";
rev = "704393448a7b0c620ee2c2b9597723f1d7f17b3d";
hash = "sha256-qNmIl+kERDiJeig6A9UjnwUd7VaO91QqhwszaszLAow=";
};
# Runtime sources match the 1.5.7 sdist, but GitHub's setup.py still declares 1.5.5.
postPatch = ''
substituteInPlace setup.py \
--replace-fail "version='1.5.5'" "version='${version}'"
'';
nativeBuildInputs = [
];
@@ -38,7 +46,7 @@ buildPythonPackage rec {
dependencies = [
matplotlib
numpy
opencv-python
opencv-python-headless
pillow
scikit-learn
torchvision