FS#70925 - [python-sphinx-autodoc-typehints] FTBFS 1.11.1-2

Attached to Project: Community Packages
Opened by kpcyrd (kpcyrd) - Monday, 17 May 2021, 23:16 GMT
Last edited by Toolybird (Toolybird) - Saturday, 24 December 2022, 04:56 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The tests started failing on a recent Arch Linux:

```
==> Starting check()...
============================= test session starts ==============================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /build/python-sphinx-autodoc-typehints/src/sphinx-autodoc-typehints, configfile: setup.cfg, testpaths: tests
collected 89 items

tests/test_dataclass_py36.py .. [ 2%]
tests/test_sphinx_autodoc_typehints.py ................................. [ 39%]
....................................................FF [100%]

=================================== FAILURES ===================================
___________________________ test_sphinx_output[True] ___________________________
tests/test_sphinx_autodoc_typehints.py:492: in test_sphinx_output
assert text_contents == expected_contents
E AssertionError: assert 'Dummy Module...-- function\n' == 'Dummy Module...-- function\n'
E Skipping 1457 identical leading characters in diff, use -v to show
E - a_property
E + a_property: str
E ? +++++
E
E Property docstring
E ...
E
E ...Full output truncated (159 lines hidden), use '-vv' to show
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: text
# srcdir: /tmp/pytest-of-builduser/pytest-0/dummy
# outdir: /tmp/pytest-of-builduser/pytest-0/dummy/_build/text
# status:
Running Sphinx v4.0.1
building [mo]: targets for 0 po files that are out of date
building [text]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
build succeeded, 3 warnings.

The text files are in ../../../../tmp/pytest-of-builduser/pytest-0/dummy/_build/text.

# warning:
WARNING: Cannot treat a function defined as a local function: "dummy_module.Class.locally_defined_callable_field" (use @functools.wraps)
WARNING: Cannot resolve forward reference in type annotations of "dummy_module.function_with_unresolvable_annotation": name 'a' is not defined
WARNING: autodoc: failed to import class 'DataClass' from module 'dummy_module'; the following exception was raised:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sphinx/util/inspect.py", line 412, in safe_getattr
return getattr(obj, name, *defargs)
AttributeError: module 'dummy_module' has no attribute 'DataClass'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/importer.py", line 110, in import_object
obj = attrgetter(obj, mangled_name)
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 318, in get_attr
return autodoc_attrgetter(self.env.app, obj, name, *defargs)
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 2606, in autodoc_attrgetter
return safe_getattr(obj, name, *defargs)
File "/usr/lib/python3.9/site-packages/sphinx/util/inspect.py", line 428, in safe_getattr
raise AttributeError(name) from exc
AttributeError: DataClass


__________________________ test_sphinx_output[False] ___________________________
tests/test_sphinx_autodoc_typehints.py:492: in test_sphinx_output
assert text_contents == expected_contents
E AssertionError: assert 'Dummy Module...-- function\n' == 'Dummy Module...-- function\n'
E Skipping 1457 identical leading characters in diff, use -v to show
E - a_property
E + a_property: str
E ? +++++
E
E Property docstring
E ...
E
E ...Full output truncated (156 lines hidden), use '-vv' to show
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: text
# srcdir: /tmp/pytest-of-builduser/pytest-0/dummy
# outdir: /tmp/pytest-of-builduser/pytest-0/dummy/_build/text
# status:
Running Sphinx v4.0.1
building [mo]: targets for 0 po files that are out of date
building [text]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
build succeeded, 3 warnings.

The text files are in ../../../../tmp/pytest-of-builduser/pytest-0/dummy/_build/text.

# warning:
WARNING: Cannot treat a function defined as a local function: "dummy_module.Class.locally_defined_callable_field" (use @functools.wraps)
WARNING: Cannot resolve forward reference in type annotations of "dummy_module.function_with_unresolvable_annotation": name 'a' is not defined
WARNING: autodoc: failed to import class 'DataClass' from module 'dummy_module'; the following exception was raised:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sphinx/util/inspect.py", line 412, in safe_getattr
return getattr(obj, name, *defargs)
AttributeError: module 'dummy_module' has no attribute 'DataClass'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/importer.py", line 110, in import_object
obj = attrgetter(obj, mangled_name)
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 318, in get_attr
return autodoc_attrgetter(self.env.app, obj, name, *defargs)
File "/usr/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 2606, in autodoc_attrgetter
return safe_getattr(obj, name, *defargs)
File "/usr/lib/python3.9/site-packages/sphinx/util/inspect.py", line 428, in safe_getattr
raise AttributeError(name) from exc
AttributeError: DataClass


=============================== warnings summary ===============================
../../../../usr/lib/python3.9/site-packages/packaging/version.py:127: 344 warnings
/usr/lib/python3.9/site-packages/packaging/version.py:127: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================== 2 failed, 87 passed, 344 warnings in 1.18s ==================
==> ERROR: A failure occurred in check().
```
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 24 December 2022, 04:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-sphinx-autodoc-typehints 1.12.1-1

Loading...