Source: python-pdoc
Version: 14.7.0-1
Severity: normal
User: debian-pyt...@lists.debian.org
Usertags: python3.13

This package failed build from source when test-built against a version of
python3-defaults that includes 3.13 as a supported version.

To reproduce this issue, build against python3-defaults (python3-all-dev etc.)
from Debian experimental.

This issue is because six refers to tkinter.tix, which got removed in
3.13. In upstream's test environment, six wouldn't be installed. I'd
suggest just patching the test (which iterates through all installed
modules) to ignore six.

What's new in Python 3.13:
https://docs.python.org/3.13/whatsnew/3.13.html

Log snippet:

   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build; 
python3.13 -m pytest -k 'not test_walk_specs and not test_parse_spec and not 
test_snapshots[html-flavors_rst] and not 
test_snapshots[html-example_customtemplate] and not 
test_snapshots[html-example_darkmode] and not 
test_snapshots[html-example_mkdocs] and not test_snapshots[html-demo_long] and 
not test_snapshots[html-demopackage_dir] and not 
snapshots[repr-pyo3_sample_library] and not 
test_snapshots[html-pyo3_sample_library] and not 
test_snapshots[repr-misc_py312]'
============================= test session starts ==============================
platform linux -- Python 3.13.0rc2, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build
configfile: pyproject.toml
testpaths: test
plugins: typeguard-4.3.0, cov-5.0.0, hypothesis-6.112.0
collected 341 items / 12 deselected / 329 selected

test/test_doc.py ............                                            [  3%]
test/test_doc_ast.py .....                                               [  5%]
test/test_doc_pyi.py ..                                                  [  5%]
test/test_doc_types.py ........                                          [  8%]
test/test_docstrings.py ..........                                       [ 11%]
test/test_extract.py ..                                                  [ 11%]
test/test_main.py ......                                                 [ 13%]
test/test_render_helpers.py .............................                [ 22%]
test/test_search.py .                                                    [ 22%]
test/test_smoke.py ..................................................... [ 38%]
........................................................................ [ 60%]
................................................................F......  [ 82%]
test/test_snapshot.py .................................................  [ 97%]
test/test_web.py .........                                               [100%]

=================================== FAILURES ===================================
_______________________________ test_smoke[six] ________________________________

module = 'six'

    @pytest.mark.slow
    @pytest.mark.filterwarnings("ignore")
    @pytest.mark.parametrize("module", modules)
    def test_smoke(module):
        try:
            with pdoc.extract.mock_some_common_side_effects():
                importlib.import_module(module)
        except pdoc.extract.AnyException:
            pass
        else:
            try:
>               pdoc.pdoc(module)

test/test_smoke.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pdoc/__init__.py:529: in pdoc
    out = render.html_module(module, all_modules)
/usr/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
pdoc/render.py:106: in html_module
    return env.get_template("module.html.jinja2").render(
/usr/lib/python3/dist-packages/jinja2/environment.py:1301: in render
    self.environment.handle_exception()
/usr/lib/python3/dist-packages/jinja2/environment.py:936: in handle_exception
    raise rewrite_traceback_stack(source=source)
pdoc/templates/default/module.html.jinja2:311: in top-level template code
    {%- if loop.nextitem -%}
pdoc/templates/default/frame.html.jinja2:36: in top-level template code
    {% block body %}
pdoc/templates/default/frame.html.jinja2:42: in block 'body'
    {% block content %}{% endblock %}
pdoc/templates/default/module.html.jinja2:101: in block 'content'
    {% block module_contents %}
pdoc/templates/default/module.html.jinja2:102: in block 'module_contents'
    {% for m in module.flattened_own_members if is_public(m) | trim %}
/usr/lib/python3/dist-packages/jinja2/environment.py:485: in getattr
    return getattr(obj, attribute)
/usr/lib/python3.13/functools.py:1037: in __get__
    val = self.func(instance)
pdoc/doc.py:368: in flattened_own_members
    [cls for cls in x.flattened_own_members if isinstance(cls, Class)]
/usr/lib/python3.13/functools.py:1037: in __get__
    val = self.func(instance)
pdoc/doc.py:364: in flattened_own_members
    for x in self.own_members:
/usr/lib/python3.13/functools.py:1037: in __get__
    val = self.func(instance)
pdoc/doc.py:716: in own_members
    members = self._members_by_origin.get((self.modulename, self.qualname), [])
/usr/lib/python3.13/functools.py:1037: in __get__
    val = self.func(instance)
pdoc/doc.py:342: in _members_by_origin
    for member in self.members.values():
/usr/lib/python3.13/functools.py:1037: in __get__
    val = self.func(instance)
pdoc/doc.py:293: in members
    doc = Function(self.modulename, qualname, obj, taken_from)  # type: ignore
pdoc/doc.py:906: in __init__
    elif hasattr(func, "__wrapped__"):
/usr/lib/python3/dist-packages/six.py:123: in __getattr__
    _module = self._resolve()
/usr/lib/python3/dist-packages/six.py:120: in _resolve
    return _import_module(self.mod)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'tkinter.tix'

    def _import_module(name):
        """Import module, returning the module after the last dot."""
>       __import__(name)
E       ModuleNotFoundError: No module named 'tkinter.tix'

/usr/lib/python3/dist-packages/six.py:87: ModuleNotFoundError
=============================== warnings summary ===============================
../../../../../../usr/lib/python3/dist-packages/_pytest/config/__init__.py:1441
  /usr/lib/python3/dist-packages/_pytest/config/__init__.py:1441: 
PytestConfigWarning: Unknown config option: timeout
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

test/test_doc_types.py::test_eval_fail2
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build/pdoc/doc_types.py:148: 
UserWarning: Error parsing type annotation xyz for a. Import of xyz failed: 
name 'xyz' is not defined
    warnings.warn(

test/test_docstrings.py::test_rst_include_invalid_options
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build/pdoc/docstrings.py:413: 
UserWarning: Cannot include '../README.md': [Errno 2] No such file or 
directory: 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build/test/../README.md'
    warnings.warn(f"Cannot include {val!r}: {e}")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED test/test_smoke.py::test_smoke[six] - ModuleNotFoundError: No module n...
========== 1 failed, 328 passed, 12 deselected, 3 warnings in 49.91s ===========
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_pdoc/build; python3.13 -m pytest -k 
'not test_walk_specs and not test_parse_spec and not 
test_snapshots[html-flavors_rst] and not 
test_snapshots[html-example_customtemplate] and not 
test_snapshots[html-example_darkmode] and not 
test_snapshots[html-example_mkdocs] and not test_snapshots[html-demo_long] and 
not test_snapshots[html-demopackage_dir] and not 
snapshots[repr-pyo3_sample_library] and not 
test_snapshots[html-pyo3_sample_library] and not 
test_snapshots[repr-misc_py312]'
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_pdoc/build; 
python3.12 -m pytest -k 'not test_walk_specs and not test_parse_spec and not 
test_snapshots[html-flavors_rst] and not 
test_snapshots[html-example_customtemplate] and not 
test_snapshots[html-example_darkmode] and not 
test_snapshots[html-example_mkdocs] and not test_snapshots[html-demo_long] and 
not test_snapshots[html-demopackage_dir] and not 
snapshots[repr-pyo3_sample_library] and not 
test_snapshots[html-pyo3_sample_library] and not 
test_snapshots[repr-misc_py312]'
============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_pdoc/build
configfile: pyproject.toml
testpaths: test
plugins: typeguard-4.3.0, cov-5.0.0, hypothesis-6.112.0
collected 358 items / 12 deselected / 346 selected

test/test_doc.py ............                                            [  3%]
test/test_doc_ast.py .....                                               [  4%]
test/test_doc_pyi.py ..                                                  [  5%]
test/test_doc_types.py ........                                          [  7%]
test/test_docstrings.py ..........                                       [ 10%]
test/test_extract.py ..                                                  [ 11%]
test/test_main.py ......                                                 [ 13%]
test/test_render_helpers.py .............................                [ 21%]
test/test_search.py .                                                    [ 21%]
test/test_smoke.py ..................................................... [ 36%]
........................................................................ [ 57%]
........................................................................ [ 78%]
................                                                         [ 83%]
test/test_snapshot.py ...s........s......s.....s.............s......s..  [ 97%]
test/test_web.py .........                                               [100%]

=============================== warnings summary ===============================
../../../../../../usr/lib/python3/dist-packages/_pytest/config/__init__.py:1441
  /usr/lib/python3/dist-packages/_pytest/config/__init__.py:1441: 
PytestConfigWarning: Unknown config option: timeout
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

test/test_doc_types.py::test_eval_fail2
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_pdoc/build/pdoc/doc_types.py:148: 
UserWarning: Error parsing type annotation xyz for a. Import of xyz failed: 
name 'xyz' is not defined
    warnings.warn(

test/test_docstrings.py::test_rst_include_invalid_options
  /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_pdoc/build/pdoc/docstrings.py:413: 
UserWarning: Cannot include '../README.md': [Errno 2] No such file or 
directory: 
'/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_pdoc/build/test/../README.md'
    warnings.warn(f"Cannot include {val!r}: {e}")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===== 340 passed, 6 skipped, 12 deselected, 3 warnings in 67.69s (0:01:07) =====
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 
3.12" returned exit code 13
make: *** [debian/rules:20: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2024-09-19T05:43:24Z

If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/artifact/787173/

This bug has been filed at "normal" severity, as we haven't started the
transition to add 3.13 as a supported version, yet. This will be raised to RC
as soon as that happens, hopefully well before trixie.

Thanks,

Stefano

Reply via email to