From 32a24e0ed8c5af03a7d69ce5077a33a2f0465df7 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 16 May 2025 14:07:24 -0400 Subject: [PATCH 1/2] chore(tox): Fix pre-release options --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 05d977951..42ec48a6b 100644 --- a/tox.ini +++ b/tox.ini @@ -64,7 +64,8 @@ pass_env = py313t-x86: UV_PYTHON set_env = pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple - pre: UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + pre: UV_INDEX=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + pre: UV_INDEX_STRATEGY=unsafe-best-match py313t: PYTHONGIL={env:PYTHONGIL:0} extras = test From 3f40a3bc0c4bd996734576a15785ad0f769a963a Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Fri, 16 May 2025 14:25:24 -0400 Subject: [PATCH 2/2] fix: Ignore warning that may not be emitted --- nibabel/tests/test_processing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nibabel/tests/test_processing.py b/nibabel/tests/test_processing.py index f1a4f0a90..7e2cc4b16 100644 --- a/nibabel/tests/test_processing.py +++ b/nibabel/tests/test_processing.py @@ -9,6 +9,7 @@ """Testing processing module""" import logging +import warnings from os.path import dirname from os.path import join as pjoin @@ -169,7 +170,8 @@ def test_resample_from_to(caplog): exp_out[1:, :, :] = data[1, :, :] assert_almost_equal(out.dataobj, exp_out) out = resample_from_to(img, trans_p_25_img) - with pytest.warns(UserWarning): # Suppress scipy warning + with warnings.catch_warnings(): + warnings.simplefilter('ignore', UserWarning) exp_out = spnd.affine_transform(data, [1, 1, 1], [-0.25, 0, 0], order=3) assert_almost_equal(out.dataobj, exp_out) # Test cval @@ -275,7 +277,8 @@ def test_resample_to_output(caplog): assert_array_equal(out_img.dataobj, np.flipud(data)) # Subsample voxels out_img = resample_to_output(Nifti1Image(data, np.diag([4, 5, 6, 1]))) - with pytest.warns(UserWarning): # Suppress scipy warning + with warnings.catch_warnings(): + warnings.simplefilter('ignore', UserWarning) exp_out = spnd.affine_transform(data, [1 / 4, 1 / 5, 1 / 6], output_shape=(5, 11, 19)) assert_array_equal(out_img.dataobj, exp_out) # Unsubsample with voxel sizes