From 1b523451b8fbfb9214f0612e6848b99dafc511c6fa479b006ee125600e056b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 9 Mar 2020 08:51:39 +0000 Subject: [PATCH] Accepting request 782143 from home:pgajdos:python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - version update to 1.10.3 * Fixed ``TypeError`` (or wrong rendered class name) when an annotation is a generic class that has a ``name`` property * Fixed inner classes missing their parent class name(s) when rendered * Fixed ``KeyError`` when encountering mocked annotations (``autodoc_mock_imports``) * Rewrote the annotation formatting logic (fixes Python 3.5.2 compatibility regressions and an ``AttributeError`` regression introduced in v1.9.0) * Fixed decorator classes not being processed as classes * Added support for typing_extensions_ * Added the ``typehints_document_rtype`` option (PR by Simon-Martin Schröder) * Fixed metaclasses as annotations causing ``TypeError`` * Fixed rendering of ``typing.Literal`` * Fixed OSError when generating docs for SQLAlchemy mapped classes * Fixed unparametrized generic classes being rendered with their type parameters (e.g. ``Dict[~KT, ~VT]``) - added patches fix use object.inv which comes with python-doc + python-sphinx-autodoc-typehints-system-object.inv.patch OBS-URL: https://build.opensuse.org/request/show/782143 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=12 --- ...-autodoc-typehints-system-object.inv.patch | 17 ++++++++++++++ python-sphinx-autodoc-typehints.changes | 22 +++++++++++++++++++ python-sphinx-autodoc-typehints.spec | 9 ++++++-- sphinx-autodoc-typehints-1.10.3.tar.gz | 3 +++ sphinx-autodoc-typehints-1.8.0.tar.gz | 3 --- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 python-sphinx-autodoc-typehints-system-object.inv.patch create mode 100644 sphinx-autodoc-typehints-1.10.3.tar.gz delete mode 100644 sphinx-autodoc-typehints-1.8.0.tar.gz diff --git a/python-sphinx-autodoc-typehints-system-object.inv.patch b/python-sphinx-autodoc-typehints-system-object.inv.patch new file mode 100644 index 0000000..65a792c --- /dev/null +++ b/python-sphinx-autodoc-typehints-system-object.inv.patch @@ -0,0 +1,17 @@ +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 3d5c6d4..4a7a3e2 100644 --- a/python-sphinx-autodoc-typehints.changes +++ b/python-sphinx-autodoc-typehints.changes @@ -1,3 +1,25 @@ +------------------------------------------------------------------- +Fri Mar 6 14:50:12 UTC 2020 - pgajdos@suse.com + +- version update to 1.10.3 + * Fixed ``TypeError`` (or wrong rendered class name) when an annotation is a generic class that has + a ``name`` property + * Fixed inner classes missing their parent class name(s) when rendered + * Fixed ``KeyError`` when encountering mocked annotations (``autodoc_mock_imports``) + * Rewrote the annotation formatting logic (fixes Python 3.5.2 compatibility regressions and an + ``AttributeError`` regression introduced in v1.9.0) + * Fixed decorator classes not being processed as classes + * Added support for typing_extensions_ + * Added the ``typehints_document_rtype`` option (PR by Simon-Martin Schröder) + * Fixed metaclasses as annotations causing ``TypeError`` + * Fixed rendering of ``typing.Literal`` + * Fixed OSError when generating docs for SQLAlchemy mapped classes + * Fixed unparametrized generic classes being rendered with their type parameters + (e.g. ``Dict[~KT, ~VT]``) +- added patches + fix use object.inv which comes with python-doc + + python-sphinx-autodoc-typehints-system-object.inv.patch + ------------------------------------------------------------------- Mon Sep 16 13:38:42 UTC 2019 - Tomáš Chvátal diff --git a/python-sphinx-autodoc-typehints.spec b/python-sphinx-autodoc-typehints.spec index 8750afa..9802abd 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) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,13 +19,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-sphinx-autodoc-typehints -Version: 1.8.0 +Version: 1.10.3 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 BuildRequires: %{python_module setuptools >= 36.2.7} BuildRequires: %{python_module setuptools_scm >= 1.7.0} BuildRequires: fdupes @@ -35,8 +37,10 @@ Requires: python-typing_extensions BuildArch: noarch # SECTION tests BuildRequires: %{python_module Sphinx >= 1.7} +BuildRequires: %{python_module doc} BuildRequires: %{python_module pathlib} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module sphobjinv} BuildRequires: %{python_module typing_extensions} # /SECTION %python_subpackages @@ -47,6 +51,7 @@ and return value types of functions. %prep %setup -q -n sphinx-autodoc-typehints-%{version} +%patch0 -p1 %build %python_build diff --git a/sphinx-autodoc-typehints-1.10.3.tar.gz b/sphinx-autodoc-typehints-1.10.3.tar.gz new file mode 100644 index 0000000..6c0a08d --- /dev/null +++ b/sphinx-autodoc-typehints-1.10.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6b3180167479aca2c4d1ed3b5cb044a70a76cccd6b38662d39288ebd9f0dff0 +size 16396 diff --git a/sphinx-autodoc-typehints-1.8.0.tar.gz b/sphinx-autodoc-typehints-1.8.0.tar.gz deleted file mode 100644 index b7dea4d..0000000 --- a/sphinx-autodoc-typehints-1.8.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d968ec3ee4f7fe7695ab6facf5cd2d74d3cea67584277458ad9b2788ebbcc3b -size 14730