Skip to content

Handler autodoc throw exceptions after >= 7.1.0 release #11543

@johnnv1

Description

@johnnv1

Describe the bug

After the 7.1 release, the kornia docs started to show warnings for throw exceptions from autodocs for some dataclass. I think is some issue with autodoc for dataclass classes.

WARNING: error while formatting arguments for kornia.contrib.models.SegmentationResults: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.contrib.models.Prompts: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.contrib.models.rt_detr.RTDETRConfig: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.contrib.models.sam.SamConfig: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.feature.DISKFeatures: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.image.ImageSize: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.image.PixelFormat: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )
WARNING: error while formatting arguments for kornia.image.ImageLayout: Handler <function update_defvalue at 0x7fef18c267a0> for event 'autodoc-before-process-signature' threw an exception (exception: )

How to Reproduce

I could not reduce it to something small and reproducible -- but all the warnings on kornia docs occurs on data classes

$ git clone git@github.com:kornia/kornia.git
$ virtualvenv venv -p python3.10
$ pip install -e .[docs]
$ make build-docs SPHINXOPTS="-W"

Environment Information

Platform:              linux; (Linux-5.19.0-50-generic-x86_64-with-glibc2.35)
Python version:        3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0])
Python implementation: CPython
Sphinx version:        7.1.0
Docutils version:      0.20.1
Jinja2 version:        3.1.2
Pygments version:      2.15.1

Sphinx extensions

i belive the issue is from: ['sphinx.ext.autodoc']

Additional context

list complete the extensions:
[
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx_autodoc_typehints',
'sphinx_autodoc_defaultargs',
'sphinx_copybutton',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinxcontrib.bibtex',
"sphinxcontrib.gtagjs",
'sphinxcontrib.youtube',
'sphinx_design',
]

this issue can also be checked on the kornia CI -- https://github.com/kornia/kornia/actions/workflows/docs.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions