[Backport release-26.05] python3Packages.{albucore,albumentations}: fix build (#543357)

This commit is contained in:
dotlambda
2026-07-19 00:34:25 +00:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@@ -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 ];

View File

@@ -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 ];