python3Package.albumentations: fix build

- 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
This commit is contained in:
Andrew Marshall
2026-07-12 20:56:47 -04:00
parent 8a4dad5b70
commit e6b482cc0b
@@ -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 ];