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..a12eca0ea7 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" @@ -169,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. 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 """ )