diff --git a/python-nibabel.changes b/python-nibabel.changes index 5e6e34e..4766194 100644 --- a/python-nibabel.changes +++ b/python-nibabel.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jul 22 05:51:49 UTC 2024 - Steve Kowalik + +- Switch to autosetup macro. +- Restrict numpy to < 2 because it isn't currently supported. +- Add patch support-pytest-8.patch: + * Use pytest setup/teardown methods. + ------------------------------------------------------------------- Mon Mar 25 20:12:25 UTC 2024 - Dirk Müller diff --git a/python-nibabel.spec b/python-nibabel.spec index 853a07c..7271849 100644 --- a/python-nibabel.spec +++ b/python-nibabel.spec @@ -25,15 +25,17 @@ License: MIT URL: https://nipy.org/nibabel # SourceRepository: https://github.com/nipy/nibabel Source: https://files.pythonhosted.org/packages/source/n/nibabel/nibabel-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#nipy/nibabel#1325 +Patch0: support-pytest-8.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module hatch-vcs} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-numpy >= 1.20 Requires: python-packaging => 17 Requires: (python-importlib-resources >= 1.3 if python-base < 3.9) +Requires: (python-numpy >= 1.20 with python-numpy < 2) Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: python-Pillow @@ -45,7 +47,7 @@ BuildArch: noarch BuildRequires: %{python_module Pillow} BuildRequires: %{python_module h5py} BuildRequires: %{python_module importlib-resources >= 1.3 if %python-base < 3.9} -BuildRequires: %{python_module numpy >= 1.20} +BuildRequires: %{python_module numpy >= 1.20 with %python-numpy < 2} BuildRequires: %{python_module packaging >= 17} BuildRequires: %{python_module pydicom >= 1} BuildRequires: %{python_module pytest-doctestplus} @@ -67,7 +69,7 @@ FreeSurfer geometry, annotation and morphometry files. There is some very limited support for DICOM. %prep -%setup -q -n nibabel-%{version} +%autosetup -p1 -n nibabel-%{version} find nibabel -name .gitignore -delete sed -i '1{/^!#/d}' nibabel/cmdline/*.py chmod a-x nibabel/cmdline/*.py diff --git a/support-pytest-8.patch b/support-pytest-8.patch new file mode 100644 index 0000000..f45ab74 --- /dev/null +++ b/support-pytest-8.patch @@ -0,0 +1,60 @@ +From 82c8588528d5a06fd0dfc99e3cbb83d5cc299e2b Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Wed, 29 May 2024 00:20:34 +0200 +Subject: [PATCH] Replace deprecated setup() and teardown() + +Those were compatibility functions for porting from nose. They are now +deprecated and have been removed from pytest. + +This will make all tests compatible with pytests 8.x. +--- + nibabel/streamlines/tests/test_streamlines.py | 2 +- + nibabel/tests/test_deprecated.py | 4 ++-- + nibabel/tests/test_dft.py | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/nibabel/streamlines/tests/test_streamlines.py b/nibabel/streamlines/tests/test_streamlines.py +index f0bd9c7c4..53a43c393 100644 +--- a/nibabel/streamlines/tests/test_streamlines.py ++++ b/nibabel/streamlines/tests/test_streamlines.py +@@ -20,7 +20,7 @@ + DATA = {} + + +-def setup(): ++def setup_module(): + global DATA + DATA['empty_filenames'] = [pjoin(data_path, 'empty' + ext) for ext in FORMATS.keys()] + DATA['simple_filenames'] = [pjoin(data_path, 'simple' + ext) for ext in FORMATS.keys()] +diff --git a/nibabel/tests/test_deprecated.py b/nibabel/tests/test_deprecated.py +index f1c3d517c..01636632e 100644 +--- a/nibabel/tests/test_deprecated.py ++++ b/nibabel/tests/test_deprecated.py +@@ -14,12 +14,12 @@ + from nibabel.tests.test_deprecator import TestDeprecatorFunc as _TestDF + + +-def setup(): ++def setup_module(): + # Hack nibabel version string + pkg_info.cmp_pkg_version.__defaults__ = ('2.0',) + + +-def teardown(): ++def teardown_module(): + # Hack nibabel version string back again + pkg_info.cmp_pkg_version.__defaults__ = (pkg_info.__version__,) + +diff --git a/nibabel/tests/test_dft.py b/nibabel/tests/test_dft.py +index 654af9827..6c6695b16 100644 +--- a/nibabel/tests/test_dft.py ++++ b/nibabel/tests/test_dft.py +@@ -26,7 +26,7 @@ + data_dir = pjoin(dirname(__file__), 'data') + + +-def setUpModule(): ++def setup_module(): + if os.name == 'nt': + raise unittest.SkipTest('FUSE not available for windows, skipping dft tests') + if not have_dicom: