Skip to content

Fail in build because of function present. #13435

@mcocdawc

Description

@mcocdawc

Describe the bug

I encountered a very strange bug, where the build just stops, that is triggered by commenting in- and out a function that does not even have a docstring.

It is most likely a bug in sphinx-autodoc-typehints (tox-dev/sphinx-autodoc-typehints#532), but the traceback says to also report it to sphinx, hence this issue.

I provide the traceback here:

Versions
========

* Platform:         linux; (Linux-6.11.0-19-generic-x86_64-with-glibc2.39)
* Python version:   3.12.3 (CPython)
* Sphinx version:   8.2.3
* Docutils version: 0.20.1
* Jinja2 version:   3.1.5
* Pygments version: 2.19.1

Last Messages
=============

    _autosummary/quemb.molbe.solver.solve_uccsd


    reading sources... [ 54%]
    _autosummary/quemb.molbe.sparse_2el_integral


    reading sources... [ 54%]
    _autosummary/quemb.molbe.sparse_2el_integral.SemiSparseSym3DTensor

Loaded Extensions
=================

* sphinx.ext.mathjax (8.2.3)
* alabaster (0.7.16)
* sphinxcontrib.applehelp (2.0.0)
* sphinxcontrib.devhelp (2.0.0)
* sphinxcontrib.htmlhelp (2.1.0)
* sphinxcontrib.serializinghtml (2.0.0)
* sphinxcontrib.qthelp (2.0.0)
* sphinx.ext.autodoc.preserve_defaults (8.2.3)
* sphinx.ext.autodoc.type_comment (8.2.3)
* sphinx.ext.autodoc.typehints (8.2.3)
* sphinx.ext.autodoc (8.2.3)
* sphinx.ext.napoleon (8.2.3)
* sphinx.ext.intersphinx (8.2.3)
* sphinx_autodoc_typehints (unknown version)
* sphinx.ext.autosummary (8.2.3)
* sphinx.ext.githubpages (8.2.3)
* sphinx_multiversion (0.2)
* furo (2024.08.06)
* sphinx_basic_ng (1.0.0.beta2)

Traceback
=========

      File "/home/mcocdawc/.venv/lib/python3.12/site-packages/sphinx/events.py", line 415, in emit
        raise ExtensionError(
    sphinx.errors.ExtensionError: Handler <function process_signature at 0x7a64740d7240> for event 'autodoc-process-signature' threw an exception (exception: 'n_unique_nonzero')


The full traceback has been saved in:
/tmp/sphinx-err-aa20u0xh.log

To report this error to the developers, please open an issue at <https://github.com/sphinx-doc/sphinx/issues/>. Thanks!
Please also report this if it was a user error, so that a better error message can be provided next time.

I appended the log file here.
log file

How to Reproduce

git clone git@github.com:troyvvgroup/quemb.git
cd quemb
git checkout 29158f323ec8063f88c3c2c1ca6b106cc712703a
pip install .
pip install -r docs/requirements.txt
cd docs
make html

will error out.

Assuming you are still in docs/, if you delete the build directory

rm -r build

and open src/quemb/molbe/sparse_2el_integral.py
and comment out SemiSparseSym3DTensor.n_unique_nonzero the build will actually work.

Environment Information

Platform:              linux; (Linux-6.11.0-19-generic-x86_64-with-glibc2.39)
Python version:        3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0])
Python implementation: CPython
Sphinx version:        8.2.3
Docutils version:      0.20.1
Jinja2 version:        3.1.5
Pygments version:      2.19.1

Sphinx extensions

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions