Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail in build because of function present. #13435

Closed
mcocdawc opened this issue Mar 17, 2025 · 1 comment
Closed

Fail in build because of function present. #13435

mcocdawc opened this issue Mar 17, 2025 · 1 comment
Labels
extensions:third party Relating to third-party extensions type:bug

Comments

@mcocdawc
Copy link

mcocdawc commented Mar 17, 2025

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 [email protected]: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

@AA-Turner
Copy link
Member

Indeed, the error is in the third-party extension:

    Traceback (most recent call last):
      File "/home/mcocdawc/.venv/lib/python3.12/site-packages/sphinx/events.py", line 404, in emit
        results.append(listener.handler(self.app, *args))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/mcocdawc/.venv/lib/python3.12/site-packages/sphinx_autodoc_typehints/__init__.py", line 414, in process_signature
        method_object = outer.__dict__[method_name] if outer else obj
                        ~~~~~~~~~~~~~~^^^^^^^^^^^^^
    KeyError: 'n_unique_nonzero'

I'll close this issue, but we can re-open if necessary.

A

@AA-Turner AA-Turner closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2025
@AA-Turner AA-Turner added the extensions:third party Relating to third-party extensions label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions:third party Relating to third-party extensions type:bug
Projects
None yet
Development

No branches or pull requests

2 participants