Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-sphinx-autodoc-typehints for 
openSUSE:Factory checked in at 2021-04-23 17:50:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinx-autodoc-typehints (Old)
 and      /work/SRC/openSUSE:Factory/.python-sphinx-autodoc-typehints.new.12324 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sphinx-autodoc-typehints"

Fri Apr 23 17:50:50 2021 rev:6 rq:888061 version:1.11.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-sphinx-autodoc-typehints/python-sphinx-autodoc-typehints.changes
  2020-03-10 14:05:52.903400813 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-sphinx-autodoc-typehints.new.12324/python-sphinx-autodoc-typehints.changes
       2021-04-23 17:51:06.618844173 +0200
@@ -1,0 +2,17 @@
+Fri Apr 23 14:24:23 UTC 2021 - Matej Cepl <[email protected]>
+
+- 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 <[email protected]>
+
+- 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)
+
+-------------------------------------------------------------------

Old:
----
  python-sphinx-autodoc-typehints-system-object.inv.patch
  sphinx-autodoc-typehints-1.10.3.tar.gz

New:
----
  no-net-tests.patch
  sphinx-autodoc-typehints-1.11.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sphinx-autodoc-typehints.spec ++++++
--- /var/tmp/diff_new_pack.T3dtTD/_old  2021-04-23 17:51:07.058844930 +0200
+++ /var/tmp/diff_new_pack.T3dtTD/_new  2021-04-23 17:51:07.062844936 +0200
@@ -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 [email protected]
+# 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 @@
 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 @@
 
 %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}/*

++++++ no-net-tests.patch ++++++
---
 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
[email protected]
 @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
[email protected]
 @pytest.mark.parametrize('library', [typing, typing_extensions],
                          ids=['typing', 'typing_extensions'])
 @pytest.mark.parametrize('annotation, params, expected_result', [
++++++ sphinx-autodoc-typehints-1.10.3.tar.gz -> 
sphinx-autodoc-typehints-1.11.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinx-autodoc-typehints-1.10.3/.gitignore 
new/sphinx-autodoc-typehints-1.11.0/.gitignore
--- old/sphinx-autodoc-typehints-1.10.3/.gitignore      2019-11-11 
20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/.gitignore      2020-06-21 
08:33:11.000000000 +0200
@@ -11,3 +11,4 @@
 dist/
 build/
 .vscode/
+.pre-commit-config.yaml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinx-autodoc-typehints-1.10.3/.travis.yml 
new/sphinx-autodoc-typehints-1.11.0/.travis.yml
--- old/sphinx-autodoc-typehints-1.10.3/.travis.yml     2019-11-11 
20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/.travis.yml     2020-06-21 
08:33:11.000000000 +0200
@@ -55,3 +55,10 @@
 install: pip install tox
 
 script: tox
+
+env:
+  global:
+    - COVERALLS_PARALLEL=true
+
+notifications:
+  webhooks: https://coveralls.io/webhook
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinx-autodoc-typehints-1.10.3/CHANGELOG.rst 
new/sphinx-autodoc-typehints-1.11.0/CHANGELOG.rst
--- old/sphinx-autodoc-typehints-1.10.3/CHANGELOG.rst   2019-11-11 
20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/CHANGELOG.rst   2020-06-21 
08:33:11.000000000 +0200
@@ -1,3 +1,13 @@
+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
+
+
 1.10.3
 ======
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinx-autodoc-typehints-1.10.3/PKG-INFO 
new/sphinx-autodoc-typehints-1.11.0/PKG-INFO
--- old/sphinx-autodoc-typehints-1.10.3/PKG-INFO        2019-11-11 
20:10:25.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/PKG-INFO        2020-06-21 
08:33:27.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: sphinx-autodoc-typehints
-Version: 1.10.3
+Version: 1.11.0
 Summary: Type hints (PEP 484) support for the Sphinx autodoc extension
 Home-page: UNKNOWN
 Author: Alex Gr??nholm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinx-autodoc-typehints-1.10.3/setup.cfg 
new/sphinx-autodoc-typehints-1.11.0/setup.cfg
--- old/sphinx-autodoc-typehints-1.10.3/setup.cfg       2019-11-11 
20:10:25.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/setup.cfg       2020-06-21 
08:33:27.000000000 +0200
@@ -26,7 +26,7 @@
 [options]
 py_modules = sphinx_autodoc_typehints
 python_requires = >=3.5.2
-install_requires = Sphinx >= 2.1
+install_requires = Sphinx >= 3.0
 
 [options.extras_require]
 test = 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.egg-info/PKG-INFO 
new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.egg-info/PKG-INFO
--- 
old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.egg-info/PKG-INFO  
    2019-11-11 20:10:25.000000000 +0100
+++ 
new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.egg-info/PKG-INFO  
    2020-06-21 08:33:27.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: sphinx-autodoc-typehints
-Version: 1.10.3
+Version: 1.11.0
 Summary: Type hints (PEP 484) support for the Sphinx autodoc extension
 Home-page: UNKNOWN
 Author: Alex Gr??nholm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.egg-info/requires.txt
 
new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.egg-info/requires.txt
--- 
old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.egg-info/requires.txt
  2019-11-11 20:10:25.000000000 +0100
+++ 
new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.egg-info/requires.txt
  2020-06-21 08:33:27.000000000 +0200
@@ -1,4 +1,4 @@
-Sphinx>=2.1
+Sphinx>=3.0
 
 [test]
 pytest>=3.1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.py 
new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.py
--- old/sphinx-autodoc-typehints-1.10.3/sphinx_autodoc_typehints.py     
2019-11-11 20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/sphinx_autodoc_typehints.py     
2020-06-21 08:33:11.000000000 +0200
@@ -5,7 +5,8 @@
 from typing import get_type_hints, TypeVar, Any, AnyStr, Tuple
 
 from sphinx.util import logging
-from sphinx.util.inspect import Signature
+from sphinx.util.inspect import signature as Signature
+from sphinx.util.inspect import stringify_signature
 
 logger = logging.getLogger(__name__)
 pydata_annotations = {'Any', 'AnyStr', 'Callable', 'ClassVar', 'Literal', 
'NoReturn', 'Optional',
@@ -41,7 +42,8 @@
         return annotation.__qualname__
     elif getattr(annotation, '_name', None):  # Required for generic aliases 
on Python 3.7+
         return annotation._name
-    elif getattr(annotation, 'name', None) and module in ('typing', 
'typing_extensions'):
+    elif (module in ('typing', 'typing_extensions')
+            and isinstance(getattr(annotation, 'name', None), str)):
         # Required for at least Pattern and Match
         return annotation.name
 
@@ -126,8 +128,7 @@
 
     # Some types require special handling
     if full_name == 'typing.NewType':
-        args_format = '\\(:py:data:`~{name}`, {{}})'.format(prefix=prefix,
-                                                            
name=annotation.__name__)
+        args_format = '\\(:py:data:`~{name}`, 
{{}})'.format(name=annotation.__name__)
         role = 'func'
     elif full_name == 'typing.Union' and len(args) == 2 and type(None) in args:
         full_name = 'typing.Optional'
@@ -161,17 +162,18 @@
     signature = Signature(obj)
     parameters = [
         param.replace(annotation=inspect.Parameter.empty)
-        for param in signature.signature.parameters.values()
+        for param in signature.parameters.values()
     ]
 
-    if '<locals>' in obj.__qualname__:
+    # The generated dataclass __init__() is weird and needs the second 
condition
+    if '<locals>' in obj.__qualname__ and not (what == 'method' and 
name.endswith('.__init__')):
         logger.warning(
             'Cannot treat a function defined as a local function: "%s"  (use 
@functools.wraps)',
             name)
         return
 
     if parameters:
-        if inspect.isclass(original_obj):
+        if inspect.isclass(original_obj) or (what == 'method' and 
name.endswith('.__init__')):
             del parameters[0]
         elif what == 'method':
             outer = inspect.getmodule(obj)
@@ -190,11 +192,11 @@
             if not isinstance(method_object, (classmethod, staticmethod)):
                 del parameters[0]
 
-    signature.signature = signature.signature.replace(
+    signature = signature.replace(
         parameters=parameters,
         return_annotation=inspect.Signature.empty)
 
-    return signature.format_args().replace('\\', '\\\\'), None
+    return stringify_signature(signature).replace('\\', '\\\\'), None
 
 
 def get_all_type_hints(obj, name):
@@ -370,16 +372,17 @@
             formatted_annotation = format_annotation(
                 annotation, 
fully_qualified=app.config.typehints_fully_qualified)
 
-            searchfor = ':param {}:'.format(argname)
+            searchfor = [':{} {}:'.format(field, argname)
+                         for field in ('param', 'parameter', 'arg', 
'argument')]
             insert_index = None
 
             for i, line in enumerate(lines):
-                if line.startswith(searchfor):
+                if any(line.startswith(search_string) for search_string in 
searchfor):
                     insert_index = i
                     break
 
             if insert_index is None and app.config.always_document_param_types:
-                lines.append(searchfor)
+                lines.append(':param {}:'.format(argname))
                 insert_index = len(lines)
 
             if insert_index is not None:
@@ -389,6 +392,10 @@
                 )
 
         if 'return' in type_hints and not inspect.isclass(original_obj):
+            # This avoids adding a return type for data class __init__ methods
+            if what == 'method' and name.endswith('.__init__'):
+                return
+
             formatted_annotation = format_annotation(
                 type_hints['return'], 
fully_qualified=app.config.typehints_fully_qualified)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinx-autodoc-typehints-1.10.3/tests/roots/test-dummy/dummy_module.py 
new/sphinx-autodoc-typehints-1.11.0/tests/roots/test-dummy/dummy_module.py
--- old/sphinx-autodoc-typehints-1.10.3/tests/roots/test-dummy/dummy_module.py  
2019-11-11 20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/tests/roots/test-dummy/dummy_module.py  
2020-06-21 08:33:11.000000000 +0200
@@ -142,7 +142,7 @@
     """
     Function docstring.
 
-    :param x: foo
+    :arg x: foo
     """
 
 
@@ -154,7 +154,7 @@
     """
     Function docstring.
 
-    :param x: foo
+    :parameter x: foo
     :param y: bar
     """
 
@@ -181,7 +181,7 @@
         """
         Method docstring.
 
-        :param x: foo
+        :arg x: foo
         """
         return 42
 
@@ -191,10 +191,10 @@
     """
     Function docstring.
 
-    :param x: foo
-    :param y: bar
-    :param z: baz
-    :param kwargs: some kwargs
+    :arg x: foo
+    :argument y: bar
+    :parameter z: baz
+    :parameter kwargs: some kwargs
     """
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinx-autodoc-typehints-1.10.3/tests/test_sphinx_autodoc_typehints.py 
new/sphinx-autodoc-typehints-1.11.0/tests/test_sphinx_autodoc_typehints.py
--- old/sphinx-autodoc-typehints-1.10.3/tests/test_sphinx_autodoc_typehints.py  
2019-11-11 20:10:08.000000000 +0100
+++ new/sphinx-autodoc-typehints-1.11.0/tests/test_sphinx_autodoc_typehints.py  
2020-06-21 08:33:11.000000000 +0200
@@ -143,6 +143,7 @@
     (Pattern,                       ':py:class:`~typing.Pattern`'),
     (Pattern[str],                  
':py:class:`~typing.Pattern`\\[:py:class:`str`]'),
     (IO,                            ':py:class:`~typing.IO`'),
+    (IO[str],                       
':py:class:`~typing.IO`\\[:py:class:`str`]'),
     (Metaclass,                     ':py:class:`~%s.Metaclass`' % __name__),
     (A,                             ':py:class:`~%s.A`' % __name__),
     (B,                             ':py:class:`~%s.B`' % __name__),
@@ -227,12 +228,6 @@
     else:
         format_args['undoc_params'] = ""
 
-    if sys.version_info < (3, 6):
-        format_args['dataclass_docstring'] = ('Initialize self.  See 
help(type(self)) for '
-                                              'accurate signature.')
-    else:
-        format_args['dataclass_docstring'] = 'Return type:\n         "None"'
-
     text_path = pathlib.Path(app.srcdir) / '_build' / 'text' / 'index.txt'
     with text_path.open('r') as f:
         text_contents = f.read().replace('???', '--')
@@ -385,7 +380,7 @@
            Return type:
               bytes
 
-        dummy_module.function_with_escaped_default(x='\\x08')
+        dummy_module.function_with_escaped_default(x='\\\\x08')
 
            Function docstring.
 
@@ -466,11 +461,11 @@
               Method docstring.
 
               Parameters:
-                 **x** (*Callable**[**[**int**, **bytes**]**, **int**]*) --
+                 **x** ("Optional"["Callable"[["int", "bytes"], "int"]]) --
                  foo
 
               Return type:
-                 ClassWithTypehintsNotInline
+                 "ClassWithTypehintsNotInline"
 
         dummy_module.undocumented_function(x)
 
@@ -485,7 +480,7 @@
 
            __init__()
 
-              {dataclass_docstring}
+              Initialize self.  See help(type(self)) for accurate signature.
 
         @dummy_module.Decorator(func)
 

Reply via email to