From 2e49cccc20aab63669f9cb893f19548e1e1bda8b97ac0c35abcaa8f17964db9e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 23 Sep 2020 13:42:57 +0000 Subject: [PATCH 1/4] - 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=14 --- python-sphinx-autodoc-typehints.changes | 10 ++++++++++ python-sphinx-autodoc-typehints.spec | 2 +- sphinx-autodoc-typehints-1.10.3.tar.gz | 3 --- sphinx-autodoc-typehints-1.11.0.tar.gz | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) delete mode 100644 sphinx-autodoc-typehints-1.10.3.tar.gz create mode 100644 sphinx-autodoc-typehints-1.11.0.tar.gz diff --git a/python-sphinx-autodoc-typehints.changes b/python-sphinx-autodoc-typehints.changes index 4a7a3e2..0eaef88 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +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 + ------------------------------------------------------------------- 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..efb204f 100644 --- a/python-sphinx-autodoc-typehints.spec +++ b/python-sphinx-autodoc-typehints.spec @@ -19,7 +19,7 @@ %{?!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 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 From 619846cf1791b2923cf27f3f90a3f210c853e98ab75660ada64ce2540d5296c4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 23 Sep 2020 13:44:30 +0000 Subject: [PATCH 2/4] - remove python-sphinx-autodoc-typehints-system-object.inv.patch (breaks the build) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=15 --- python-sphinx-autodoc-typehints.changes | 1 + python-sphinx-autodoc-typehints.spec | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/python-sphinx-autodoc-typehints.changes b/python-sphinx-autodoc-typehints.changes index 0eaef88..5a41e05 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -7,6 +7,7 @@ Wed Sep 23 13:29:55 UTC 2020 - Dirk Mueller * 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 efb204f..11aca73 100644 --- a/python-sphinx-autodoc-typehints.spec +++ b/python-sphinx-autodoc-typehints.spec @@ -26,8 +26,6 @@ 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 BuildRequires: %{python_module setuptools >= 36.2.7} BuildRequires: %{python_module setuptools_scm >= 1.7.0} BuildRequires: fdupes @@ -51,7 +49,6 @@ and return value types of functions. %prep %setup -q -n sphinx-autodoc-typehints-%{version} -%patch0 -p1 %build %python_build From 278aec572299e8dec97902f9bb62ec1cdfecec48f5da00d4451c9701d23139e1 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 23 Sep 2020 13:44:38 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=16 --- ...nx-autodoc-typehints-system-object.inv.patch | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 python-sphinx-autodoc-typehints-system-object.inv.patch 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) From 96d010c0f2f7f9d094a9fc13e6c53628e32c73b74e70b98914637bbdb4b72eff Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 23 Apr 2021 14:24:54 +0000 Subject: [PATCH 4/4] - Add no-net-tests.patch which marks tests requiring network (gh#agronholm/sphinx-autodoc-typehints#174). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=17 --- no-net-tests.patch | 36 +++++++++++++++++++++++++ python-sphinx-autodoc-typehints.changes | 6 +++++ python-sphinx-autodoc-typehints.spec | 9 ++++--- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 no-net-tests.patch 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.changes b/python-sphinx-autodoc-typehints.changes index 5a41e05..52e1880 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/python-sphinx-autodoc-typehints.spec b/python-sphinx-autodoc-typehints.spec index 11aca73..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 @@ -26,6 +26,9 @@ 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 +# 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 @@ -48,7 +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} +%autosetup -p1 -n sphinx-autodoc-typehints-%{version} %build %python_build @@ -59,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}/*