public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-scikit-image] f45: Fix tests affected by deprecations in numpy and pytest
@ 2026-09-09 8:44 Sergio Pascual
0 siblings, 0 replies; only message in thread
From: Sergio Pascual @ 2026-09-09 8:44 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-scikit-image
Branch : f45
Commit : e52acf82a08878d44647c0242fecc08112df8489
Author : Sergio Pascual <sergiopr@fedoraproject.org>
Date : 2026-09-09T10:12:29+02:00
Stats : +124/-3 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/python-scikit-image/c/e52acf82a08878d44647c0242fecc08112df8489?branch=f45
Log:
Fix tests affected by deprecations in numpy and pytest
---
diff --git a/fix-numpy25.patch b/fix-numpy25.patch
new file mode 100644
index 0000000..ea7ff4c
--- /dev/null
+++ b/fix-numpy25.patch
@@ -0,0 +1,12 @@
+diff -ur a/src/skimage/util/_map_array.py b/src/skimage/util/_map_array.py
+--- a/src/skimage/util/_map_array.py 2026-09-08 17:02:21.631914152 +0200
++++ b/src/skimage/util/_map_array.py 2026-09-08 17:05:40.745653059 +0200
+@@ -58,7 +58,7 @@
+ )
+ try:
+ out_view = out.view()
+- out_view.shape = (-1,) # no-copy reshape/ravel
++ out_view = np.reshape(out_view, (-1,), copy=False)
+ except AttributeError: # if out strides are not compatible with 0-copy
+ raise ValueError(
+ 'If out array is provided, it should be either contiguous '
diff --git a/pytest-param-iterators.patch b/pytest-param-iterators.patch
new file mode 100644
index 0000000..86737d0
--- /dev/null
+++ b/pytest-param-iterators.patch
@@ -0,0 +1,92 @@
+diff -ur a/tests/skimage/registration/test_phase_cross_correlation.py b/tests/skimage/registration/test_phase_cross_correlation.py
+--- a/tests/skimage/registration/test_phase_cross_correlation.py 2026-09-08 16:40:21.634314419 +0200
++++ b/tests/skimage/registration/test_phase_cross_correlation.py 2026-09-08 16:41:13.473682833 +0200
+@@ -179,7 +179,7 @@
+
+ @pytest.mark.parametrize(
+ ('shift0', 'shift1'),
+- itertools.product((100, -100, 350, -350), (100, -100, 350, -350)),
++ list(itertools.product((100, -100, 350, -350), (100, -100, 350, -350))),
+ )
+ def test_disambiguate_2d(shift0, shift1):
+ image = eagle()[500:, 900:] # use a highly textured part of image
+diff -ur a/tests/skimage/restoration/test_denoise.py b/tests/skimage/restoration/test_denoise.py
+--- a/tests/skimage/restoration/test_denoise.py 2026-09-08 16:40:21.640932650 +0200
++++ b/tests/skimage/restoration/test_denoise.py 2026-09-08 16:41:40.389870589 +0200
+@@ -855,7 +855,7 @@
+ @xfail_without_pywt
+ @pytest.mark.parametrize(
+ 'rescale_sigma, method, ndim',
+- itertools.product([True, False], ['VisuShrink', 'BayesShrink'], range(1, 5)),
++ list(itertools.product([True, False], ['VisuShrink', 'BayesShrink'], range(1, 5))),
+ )
+ def test_wavelet_denoising_nd(rescale_sigma, method, ndim):
+ rstate = np.random.default_rng(1234)
+diff -ur a/tests/skimage/transform/test_geometric.py b/tests/skimage/transform/test_geometric.py
+--- a/tests/skimage/transform/test_geometric.py 2026-09-08 16:40:21.641938210 +0200
++++ b/tests/skimage/transform/test_geometric.py 2026-09-08 16:44:50.929260134 +0200
+@@ -324,7 +324,7 @@
+
+ @pytest.mark.parametrize(
+ 'pts, params',
+- product(
++ list(product(
+ (SRC, DST),
+ (
+ dict(scale=(4, 5), shear=(1.4, 1.8), rotation=0.4, translation=(10, 12)),
+@@ -332,7 +332,7 @@
+ scale=(-0.5, 3), shear=(-0.3, -0.1), rotation=1.4, translation=(-4, 3)
+ ),
+ ),
+- ),
++ ))
+ )
+ def test_affine_params(pts, params):
+ # Test AffineTransform against docstring algorithm.
+diff -ur a/tests/skimage/transform/test_radon_transform.py b/tests/skimage/transform/test_radon_transform.py
+--- a/tests/skimage/transform/test_radon_transform.py 2026-09-08 16:40:21.642151944 +0200
++++ b/tests/skimage/transform/test_radon_transform.py 2026-09-08 16:46:46.306964028 +0200
+@@ -143,11 +143,11 @@
+
+ @pytest.mark.parametrize(
+ "size, theta, circle",
+- itertools.product(
++ list(itertools.product(
+ sizes_for_test_iradon_center,
+ thetas_for_test_iradon_center,
+ circles_for_test_iradon_center,
+- ),
++ )),
+ )
+ def test_iradon_center(size, theta, circle):
+ check_iradon_center(size, theta, circle)
+@@ -252,7 +252,7 @@
+
+
+ @pytest.mark.parametrize(
+- "shape, coordinate", generate_test_data_for_radon_iradon_minimal(shapes)
++ "shape, coordinate", list(generate_test_data_for_radon_iradon_minimal(shapes))
+ )
+ def test_radon_iradon_minimal(shape, coordinate):
+ check_radon_iradon_minimal(shape, coordinate)
+@@ -373,7 +373,7 @@
+
+ @pytest.mark.parametrize(
+ "shape, interpolation, output_size",
+- itertools.product(shapes_radon_iradon_circle, interpolations, output_sizes),
++ list(itertools.product(shapes_radon_iradon_circle, interpolations, output_sizes)),
+ )
+ def test_radon_iradon_circle(shape, interpolation, output_size):
+ check_radon_iradon_circle(interpolation, shape, output_size)
+diff -ur a/tests/skimage/util/test_dtype.py b/tests/skimage/util/test_dtype.py
+--- a/tests/skimage/util/test_dtype.py 2026-09-08 16:40:21.642526756 +0200
++++ b/tests/skimage/util/test_dtype.py 2026-09-08 16:47:26.352700023 +0200
+@@ -39,7 +39,7 @@
+ assert x.dtype == dtype
+
+
+-@parametrize("dtype, f_and_dt", itertools.product(dtype_range, img_funcs_and_types))
++@parametrize("dtype, f_and_dt", list(itertools.product(dtype_range, img_funcs_and_types)))
+ def test_range(dtype, f_and_dt):
+ imin, imax = dtype_range[dtype]
+ x = np.linspace(imin, imax, 10).astype(dtype)
diff --git a/python-scikit-image.spec b/python-scikit-image.spec
index 4987af5..f4a37a4 100644
--- a/python-scikit-image.spec
+++ b/python-scikit-image.spec
@@ -7,7 +7,7 @@
Name: python-scikit-image
Version: 0.26.0
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Image processing in Python
# The following files are BSD 2 clauses, the rest BSD 3 clauses
# skimage/graph/_mcp.pyx
@@ -24,6 +24,11 @@ Source1: scikit-image-data-20260521.tar.xz
# Rebased from: https://github.com/scikit-image/scikit-image/commit/9d8daba419249
Patch: fix-pillow-Image-getdata-deprecation.patch
+# .shape cant be used in numpy>= 2.5 instead of reshape, backported
+Patch: fix-numpy25.patch
+# can't use iterators in pytest parametrize
+Patch: pytest-param-iterators.patch
+
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}
@@ -49,12 +54,13 @@ BuildRequires: %{py3_dist astropy}
BuildRequires: %{py3_dist dask}
BuildRequires: %{py3_dist matplotlib}
BuildRequires: %{py3_dist numpydoc}
+BuildRequires: %{py3_dist pillow}
BuildRequires: %{py3_dist pooch}
BuildRequires: %{py3_dist PyWavelets}
+BuildRequires: %{py3_dist scikit-learn}
# Unpackaged optional test deps
#BuildRequires: %%{py3_dist imread}
#BuildRequires: %%{py3_dist SimpleITK}
-#BuildRequires: %%{py3_dist sklearn}
%endif
Obsoletes: %{srcname}-tools < 0.20.0
@@ -93,7 +99,17 @@ export XDG_CONFIG_HOME=$PWD
# We deselect tests that require network data
# Needs pytest_pretty
rm -f tests/conftest.py
-%pytest -v \
+%pytest -W "default::DeprecationWarning" \
+ --deselect="tests/skimage/measure/test_fit.py::test_ellipse_model_estimate" \
+ --deselect="tests/skimage/measure/test_fit.py::test_ellipse_parameter_stability" \
+ --deselect="tests/skimage/io/test_pil.py::test_all_mono" \
+ --deselect="tests/skimage/measure/test_fit.py::test_circle_model_estimate" \
+ --deselect="tests/skimage/measure/test_fit.py::test_circle_model_int_overflow" \
+ --deselect="tests/skimage/measure/test_fit.py::test_circle_model_estimate_from_small_scale_data" \
+ --deselect="tests/skimage/measure/test_fit.py::test_ellipse_model_estimate_from_data" \
+ --deselect="tests/skimage/measure/test_fit.py::test_ellipse_model_estimate_from_far_shifted_data" \
+ --deselect="tests/skimage/measure/test_fit.py::test_init_estimate_deprecations" \
+ --deselect="tests/skimage/transform/test_geometric.py::test_polynomial_weighted_estimation" \
--deselect="tests/skimage/data/test_data.py::test_brain_3d" \
--deselect="tests/skimage/data/test_data.py::test_download_all_with_pooch" \
--deselect="tests/skimage/data/test_data.py::test_kidney_3d_multichannel" \
@@ -118,6 +134,7 @@ rm -f tests/conftest.py
tests/skimage
%endif
+
%files -n python3-%{srcname} -f %{pyproject_files}
%doc CONTRIBUTORS.md README.md SECURITY.md
%license LICENSE.txt
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-09 8:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09 8:44 [rpms/python-scikit-image] f45: Fix tests affected by deprecations in numpy and pytest Sergio Pascual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox