diff --git a/522.patch b/522.patch new file mode 100644 index 0000000..ef4a7a9 --- /dev/null +++ b/522.patch @@ -0,0 +1,108 @@ +From f851356e8e56c67df96e9c7ec70e82f98bcc2efd Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 22 Sep 2023 11:40:47 -0400 +Subject: [PATCH 1/2] Drop the PyPI mock dependency + +This was only needed for Python 2.7. +--- + README.rst | 6 ++---- + dev-requirements.txt | 1 - + nipy/info.py | 6 +----- + 3 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/README.rst b/README.rst +index 9deb1a196..79fa12dea 100644 +--- a/README.rst ++++ b/README.rst +@@ -74,10 +74,9 @@ Tests + ===== + + To run nipy's tests, you will need to install the nose_ Python testing +-package. If you are using Python 2.7, you will also need to install the mock_ +-testing package - e.g.:: ++package:: + +- pip install nose mock ++ pip install nose + + Then:: + +@@ -112,5 +111,4 @@ the nipy distribution. + .. _ipython: http://ipython.org + .. _matplotlib: http://matplotlib.org + .. _nose: http://nose.readthedocs.org/en/latest +-.. _mock: https://pypi.python.org/pypi/mock + .. _installation instructions: http://nipy.org/nipy/users/installation.html +diff --git a/dev-requirements.txt b/dev-requirements.txt +index aa8ad84f8..e083121ec 100644 +--- a/dev-requirements.txt ++++ b/dev-requirements.txt +@@ -1,4 +1,3 @@ + # Requirements for running tests + -r requirements.txt + nose3 +-mock +diff --git a/nipy/info.py b/nipy/info.py +index a7fe66905..d44375884 100644 +--- a/nipy/info.py ++++ b/nipy/info.py +@@ -102,10 +102,7 @@ + ===== + + To run nipy's tests, you will need to install the nose_ Python testing +-package. If you are using Python 2.7, you will also need to install the mock_ +-testing package - e.g.:: +- +- pip install nose mock ++package:: + + Then:: + +@@ -140,7 +137,6 @@ + .. _ipython: http://ipython.org + .. _matplotlib: http://matplotlib.org + .. _nose: http://nose.readthedocs.org/en/latest +-.. _mock: https://pypi.python.org/pypi/mock + .. _six: https://six.readthedocs.io + .. _installation instructions: http://nipy.org/nipy/users/installation.html + """ + +From 8daea8dcef620bef3959f3bbaea65576c4dfb8b4 Mon Sep 17 00:00:00 2001 +From: Ben Beasley +Date: Fri, 22 Sep 2023 11:49:34 -0400 +Subject: [PATCH 2/2] In documentation, recommend pip-installing nose3 instead + of nose + +Co-authored-by: Matthew Brett +--- + README.rst | 2 +- + nipy/info.py | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/README.rst b/README.rst +index 79fa12dea..b7890158d 100644 +--- a/README.rst ++++ b/README.rst +@@ -76,7 +76,7 @@ Tests + To run nipy's tests, you will need to install the nose_ Python testing + package:: + +- pip install nose ++ pip install nose3 + + Then:: + +diff --git a/nipy/info.py b/nipy/info.py +index d44375884..c6e5ccb23 100644 +--- a/nipy/info.py ++++ b/nipy/info.py +@@ -104,6 +104,9 @@ + To run nipy's tests, you will need to install the nose_ Python testing + package:: + ++ pip install nose3 ++ ++ + Then:: + + python -c "import nipy; nipy.test()" diff --git a/python-nipy.spec b/python-nipy.spec index 787b238..68f3026 100644 --- a/python-nipy.spec +++ b/python-nipy.spec @@ -34,6 +34,9 @@ Source14: nipy_tsdiffana.1 # Upstream’s version bound is chosen for binary compatibility, which is # much more tightly controlled in a distribution package Patch: 0001-Downstream-only-allow-numpy-1.24.patch +# Drop the PyPI mock dependency +# https://github.com/nipy/nipy/pull/522 +Patch: https://github.com/nipy/nipy/pull/522.patch BuildRequires: gcc BuildRequires: flexiblas-devel @@ -47,8 +50,6 @@ BuildRequires: python3dist(numpy) BuildRequires: python3dist(matplotlib) %if %{with tests} -# https://fedoraproject.org/wiki/Changes/DeprecateNose -BuildRequires: python3dist(nose) BuildRequires: nipy-data # An indirect dependency, via nibabel.testing (for nibabel 5.x) BuildRequires: python3dist(pytest) @@ -145,9 +146,9 @@ cp -p nipy/algorithms/statistics/models/LICENSE.txt scipy-LICENSE.txt # Remove doc dependency version pins, which we cannot respect sed -r -i -e 's/(,<.*)$//' -e 's/==/>=/' doc-requirements.txt # We don’t have a python-nose3 package (a fork and drop-in replacement for the -# deprecated python-nose). We also shouldn’t depend on the deprecated -# python-mock package if we can help it. -sed -r -i 's/^(nose3|mock)\b/# &/' dev-requirements.txt +# deprecated python-nose). See: +# https://fedoraproject.org/wiki/Changes/DeprecateNose +sed -r -i 's/\bnose3\b/nose/' setup.py dev-requirements.txt # Upstream pins a numpy version in order to build forward-compatible wheels for # PyPI; we can’t respect the version pin, but we also don’t need it, as we only @@ -156,7 +157,7 @@ sed -r -i 's/(numpy)==/\1>=/' pyproject.toml %generate_buildrequires -%pyproject_buildrequires %{?with_doc_pdf:doc-requirements.txt} +%pyproject_buildrequires dev-requirements.txt %{?with_doc_pdf:doc-requirements.txt} %build