python3Packages.imageio: patch failing tests (#447685)

This commit is contained in:
Vladimír Čunát
2025-10-02 08:49:21 +02:00
@@ -4,6 +4,7 @@
buildPythonPackage,
fetchFromGitHub,
isPyPy,
fetchpatch2,
# build-system
setuptools,
@@ -24,9 +25,10 @@
tifffile,
# tests
pytestCheckHook,
gitMinimal,
fsspec,
gitMinimal,
pytestCheckHook,
writableTmpDirAsHomeHook,
}:
let
@@ -52,6 +54,19 @@ buildPythonPackage rec {
hash = "sha256-/nxJxZrTYX7F2grafIWwx9SyfR47ZXyaUwPHMEOdKkI=";
};
patches = [
(fetchpatch2 {
# https://github.com/imageio/imageio/issues/1139
# https://github.com/imageio/imageio/pull/1144
name = "fix-pyav-13-1-compat";
url = "https://github.com/imageio/imageio/commit/eadfc5906f5c2c3731f56a582536dbc763c3a7a9.patch";
excludes = [
"setup.py"
];
hash = "sha256-xBYdhK6XmJJuChqXOIdRVf8X6/GpWLG+21+cPVZ4bVg=";
})
];
postPatch = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace tests/test_core.py \
--replace-fail 'ctypes.util.find_library("GL")' '"${libgl}"'
@@ -90,15 +105,16 @@ buildPythonPackage rec {
gitMinimal
psutil
pytestCheckHook
writableTmpDirAsHomeHook
]
++ fsspec.optional-dependencies.github
++ lib.flatten (builtins.attrValues optional-dependencies);
pytestFlags = [ "--test-images=file://${test_images}" ];
# These should have had `needs_internet` mark applied but don't so far.
# See https://github.com/imageio/imageio/pull/1142
disabledTests = [
# These should have had `needs_internet` mark applied but don't so far.
# See https://github.com/imageio/imageio/pull/1142
"test_read_stream"
"test_uri_reading"
"test_trim_filter"
@@ -111,7 +127,6 @@ buildPythonPackage rec {
preCheck = ''
export IMAGEIO_USERDIR=$(mktemp -d)
export HOME=$(mktemp -d)
'';
meta = {