From 839049de1b0f0285daeb724e3fc7923a6ae4620d Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 12 Jul 2026 17:45:24 -0400 Subject: [PATCH 1/2] python3Package.albucore: fix build pkg_resources is removed in setuptools 82 ([src][1]) [1]: https://github.com/pypa/setuptools/blob/v82.0.0/NEWS.rst (cherry picked from commit 8a4dad5b702587042978fa159394f5c18480b4e1) --- pkgs/development/python-modules/albucore/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/albucore/default.nix b/pkgs/development/python-modules/albucore/default.nix index f1b98394fb77..8000174085d1 100644 --- a/pkgs/development/python-modules/albucore/default.nix +++ b/pkgs/development/python-modules/albucore/default.nix @@ -22,6 +22,13 @@ buildPythonPackage rec { hash = "sha256-frVMPW3au/6vPRY89GIt7chCPkUMl13DpPqCPqIjz/o="; }; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail \ + 'from pkg_resources import DistributionNotFound, get_distribution' \ + 'from importlib.metadata import PackageNotFoundError as DistributionNotFound, distribution as get_distribution' + ''; + pythonRelaxDeps = [ "opencv-python" ]; build-system = [ setuptools ]; From 698fd8591433dd9d75df43a542d6aa62adcfa818 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sun, 12 Jul 2026 17:45:24 -0400 Subject: [PATCH 2/2] python3Package.albumentations: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pkg_resources is removed in setuptools 82 ([src][1]) - test_blur was failing with “ValueError: The truth value of an array with more than one element is ambiguous”; converting sigma to float (from `numpy.float64`) resolves, see also [this issue][2] [1]: https://github.com/pypa/setuptools/blob/v82.0.0/NEWS.rst [2]: https://github.com/python-pillow/Pillow/issues/8911 (cherry picked from commit e6b482cc0bb9f7a72538f154b5572885a8146ede) --- .../python-modules/albumentations/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/albumentations/default.nix b/pkgs/development/python-modules/albumentations/default.nix index 0cf23c5bf18e..623187c8e1ec 100644 --- a/pkgs/development/python-modules/albumentations/default.nix +++ b/pkgs/development/python-modules/albumentations/default.nix @@ -44,6 +44,17 @@ buildPythonPackage rec { ./dont-check-for-updates.patch ]; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail \ + 'from pkg_resources import DistributionNotFound, get_distribution' \ + 'from importlib.metadata import PackageNotFoundError as DistributionNotFound, distribution as get_distribution' + substituteInPlace tests/test_blur.py \ + --replace-fail \ + '(ImageFilter.GaussianBlur(radius=sigma))' \ + '(ImageFilter.GaussianBlur(radius=float(sigma)))' + ''; + pythonRelaxDeps = [ "opencv-python" ]; build-system = [ setuptools ];