diff --git a/no-net-tests.patch b/no-net-tests.patch new file mode 100644 index 0000000..d89bb79 --- /dev/null +++ b/no-net-tests.patch @@ -0,0 +1,36 @@ +--- + setup.cfg | 2 ++ + tests/test_sphinx_autodoc_typehints.py | 4 ++++ + 2 files changed, 6 insertions(+) + +--- a/setup.cfg ++++ b/setup.cfg +@@ -43,6 +43,8 @@ max-line-length = 99 + [tool:pytest] + addopts = -rsx --tb=short + testpaths = tests ++markers = ++ network: marks tests which require network connection + + [egg_info] + tag_build = +--- a/tests/test_sphinx_autodoc_typehints.py ++++ b/tests/test_sphinx_autodoc_typehints.py +@@ -95,6 +95,8 @@ def test_parse_annotation(annotation, mo + assert get_annotation_args(annotation, module, class_name) == args + + ++# requires inv fixtures which doesn't work without network connection ++@pytest.mark.network + @pytest.mark.parametrize('annotation, expected_result', [ + (str, ':py:class:`str`'), + (int, ':py:class:`int`'), +@@ -177,6 +179,8 @@ def test_format_annotation(inv, annotati + assert m.group('role') == expected_role + + ++# requires inv fixtures which doesn't work without network connection ++@pytest.mark.network + @pytest.mark.parametrize('library', [typing, typing_extensions], + ids=['typing', 'typing_extensions']) + @pytest.mark.parametrize('annotation, params, expected_result', [ diff --git a/python-sphinx-autodoc-typehints-system-object.inv.patch b/python-sphinx-autodoc-typehints-system-object.inv.patch deleted file mode 100644 index 65a792c..0000000 --- a/python-sphinx-autodoc-typehints-system-object.inv.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: sphinx-autodoc-typehints-1.10.3/tests/conftest.py -=================================================================== ---- sphinx-autodoc-typehints-1.10.3.orig/tests/conftest.py 2019-11-11 20:10:08.000000000 +0100 -+++ sphinx-autodoc-typehints-1.10.3/tests/conftest.py 2020-03-06 15:49:28.411760937 +0100 -@@ -13,10 +13,8 @@ collect_ignore = ['roots'] - - @pytest.fixture(scope='session') - def inv(pytestconfig): -- cache_path = 'python{v.major}.{v.minor}/objects.inv'.format(v=sys.version_info) -- inv_dict = pytestconfig.cache.get(cache_path, None) -- if inv_dict is not None: -- return Inventory(inv_dict) -+ inv_dict = '/usr/share/doc/packages/python3/html/objects.inv' -+ return Inventory(inv_dict) - - print("Downloading objects.inv") - url = 'https://docs.python.org/{v.major}.{v.minor}/objects.inv'.format(v=sys.version_info) diff --git a/python-sphinx-autodoc-typehints.changes b/python-sphinx-autodoc-typehints.changes index 4a7a3e2..52e1880 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Fri Apr 23 14:24:23 UTC 2021 - Matej Cepl + +- Add no-net-tests.patch which marks tests requiring network + (gh#agronholm/sphinx-autodoc-typehints#174). + +------------------------------------------------------------------- +Wed Sep 23 13:29:55 UTC 2020 - Dirk Mueller + +- update to 1.11.0: + * Dropped support for Sphinx < 3.0 + * Added support for alternative parameter names (``arg``, ``argument``, ``parameter``) + * Fixed import path for Signature (PR by Matthew Treinish) + * Fixed ``TypeError`` when formatting a parametrized ``typing.IO`` annotation + * Fixed data class displaying a return type in its ``__init__()`` method +- remove python-sphinx-autodoc-typehints-system-object.inv.patch (breaks the build) + ------------------------------------------------------------------- Fri Mar 6 14:50:12 UTC 2020 - pgajdos@suse.com diff --git a/python-sphinx-autodoc-typehints.spec b/python-sphinx-autodoc-typehints.spec index 9802abd..cb17239 100644 --- a/python-sphinx-autodoc-typehints.spec +++ b/python-sphinx-autodoc-typehints.spec @@ -1,7 +1,7 @@ # # spec file for package python-sphinx-autodoc-typehints # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,15 +19,16 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-sphinx-autodoc-typehints -Version: 1.10.3 +Version: 1.11.0 Release: 0 Summary: Type hints (PEP 484) support for the Sphinx autodoc extension License: MIT Group: Development/Languages/Python URL: https://github.com/agronholm/sphinx-autodoc-typehints Source: https://files.pythonhosted.org/packages/source/s/sphinx-autodoc-typehints/sphinx-autodoc-typehints-%{version}.tar.gz -# use object.inv which comes with python-doc; TODO more elegant solution -Patch0: python-sphinx-autodoc-typehints-system-object.inv.patch +# PATCH-FIX-UPSTREAM no-net-tests.patch gh#agronholm/sphinx-autodoc-typehints#174 mcepl@suse.com +# skip network tests +Patch0: no-net-tests.patch BuildRequires: %{python_module setuptools >= 36.2.7} BuildRequires: %{python_module setuptools_scm >= 1.7.0} BuildRequires: fdupes @@ -50,8 +51,7 @@ This is a Sphinx extension which allows to use Python 3 annotations for document and return value types of functions. %prep -%setup -q -n sphinx-autodoc-typehints-%{version} -%patch0 -p1 +%autosetup -p1 -n sphinx-autodoc-typehints-%{version} %build %python_build @@ -62,7 +62,7 @@ and return value types of functions. %check # test_sphinx_output -- too depenedent on sphinx version available -%pytest -k 'not test_sphinx_output' +%pytest -k 'not (test_sphinx_output or network)' %files %{python_files} %{python_sitelib}/* diff --git a/sphinx-autodoc-typehints-1.10.3.tar.gz b/sphinx-autodoc-typehints-1.10.3.tar.gz deleted file mode 100644 index 6c0a08d..0000000 --- a/sphinx-autodoc-typehints-1.10.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a6b3180167479aca2c4d1ed3b5cb044a70a76cccd6b38662d39288ebd9f0dff0 -size 16396 diff --git a/sphinx-autodoc-typehints-1.11.0.tar.gz b/sphinx-autodoc-typehints-1.11.0.tar.gz new file mode 100644 index 0000000..09a9dcc --- /dev/null +++ b/sphinx-autodoc-typehints-1.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbf0b203f1019b0f9843ee8eef0cff856dc04b341f6dbe1113e37f2ebf243e11 +size 16676