From b9e18cac3164e7c18b2a88cce82c7a67d2642c4a Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sun, 20 Mar 2022 21:25:04 -0400 Subject: [PATCH 1/3] MNT: Test on Python 3.10 --- .github/workflows/tests.yml | 4 ++-- nipype/info.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 82676ee28c..714244e94a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ['ubuntu-18.04'] - python-version: [3.6, 3.7, 3.8, 3.9] + os: ['ubuntu-latest'] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] check: ['test'] pip-flags: [''] depends: ['REQUIREMENTS'] diff --git a/nipype/info.py b/nipype/info.py index c9df1dbc0a..75ad74dee9 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -57,6 +57,8 @@ def get_nipype_gitversion(): "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering", ] PYTHON_REQUIRES = ">= 3.6" From 0501b79483d799a46367e851af4118be25d5db6f Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sun, 20 Mar 2022 21:36:31 -0400 Subject: [PATCH 2/3] MNT: sphinxcontrib.napoleon is now sphinx.ext.napoleon --- nipype/info.py | 1 - nipype/sphinxext/apidoc/__init__.py | 2 +- nipype/sphinxext/apidoc/docstring.py | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nipype/info.py b/nipype/info.py index 75ad74dee9..a12eca0ea7 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -171,7 +171,6 @@ def get_nipype_gitversion(): "sphinx-argparse", "sphinx>=2.1.2", "sphinxcontrib-apidoc", - "sphinxcontrib-napoleon", ], "duecredit": ["duecredit"], "nipy": ["nitime", "nilearn", "dipy", "nipy", "matplotlib"], diff --git a/nipype/sphinxext/apidoc/__init__.py b/nipype/sphinxext/apidoc/__init__.py index e3a8670d94..7392973536 100644 --- a/nipype/sphinxext/apidoc/__init__.py +++ b/nipype/sphinxext/apidoc/__init__.py @@ -2,7 +2,7 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: """Settings for sphinxext.interfaces and connection to sphinx-apidoc.""" import re -from sphinxcontrib.napoleon import ( +from sphinx.ext.napoleon import ( Config as NapoleonConfig, _patch_python_domain, _skip_member as _napoleon_skip_member, diff --git a/nipype/sphinxext/apidoc/docstring.py b/nipype/sphinxext/apidoc/docstring.py index 445a95bfa2..f1f27ef12a 100644 --- a/nipype/sphinxext/apidoc/docstring.py +++ b/nipype/sphinxext/apidoc/docstring.py @@ -2,8 +2,8 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: """Reformat interface docstrings.""" import re -from sphinxcontrib.napoleon._upstream import _ -from sphinxcontrib.napoleon.docstring import NumpyDocstring +from sphinx.locale import _ +from sphinx.ext.napoleon.docstring import NumpyDocstring class NipypeDocstring(NumpyDocstring): @@ -34,7 +34,7 @@ class InterfaceDocstring(NipypeDocstring): docstring : :obj:`str` or :obj:`list` of :obj:`str` The docstring to parse, given either as a string or split into individual lines. - config: :obj:`sphinxcontrib.napoleon.Config` or :obj:`sphinx.config.Config` + config: :obj:`sphinx.ext.napoleon.Config` or :obj:`sphinx.config.Config` The configuration settings to use. If not given, defaults to the config object on `app`; or if `app` is not given defaults to the a new :class:`nipype.sphinxext.apidoc.Config` object. From 9ae5c67094bd94c668433127eecf135182927e02 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sun, 20 Mar 2022 21:51:44 -0400 Subject: [PATCH 3/3] MNT: Set expected CLI output based on Python version --- nipype/utils/tests/test_cmd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nipype/utils/tests/test_cmd.py b/nipype/utils/tests/test_cmd.py index 211cc48a55..55b1a3e67c 100644 --- a/nipype/utils/tests/test_cmd.py +++ b/nipype/utils/tests/test_cmd.py @@ -45,9 +45,13 @@ def test_main_returns_0_on_help(self): assert exit_exception.code == 0 assert stderr.getvalue() == "" + if sys.version_info >= (3, 10): + options = "options" + else: + options = "optional arguments" assert ( stdout.getvalue() - == """usage: nipype_cmd [-h] module interface + == f"""usage: nipype_cmd [-h] module interface Nipype interface runner @@ -55,7 +59,7 @@ def test_main_returns_0_on_help(self): module Module name interface Interface name -optional arguments: +{options}: -h, --help show this help message and exit """ )