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

Freeze during generation of HTML (with typing) #154

Open
mikir opened this issue Oct 7, 2022 · 8 comments
Open

Freeze during generation of HTML (with typing) #154

mikir opened this issue Oct 7, 2022 · 8 comments
Labels

Comments

@mikir
Copy link

mikir commented Oct 7, 2022

Consider the following source bar.py:

import typing

class Bar:
    def type_info():
        return None

    ROW_ANNOTATION = typing.Tuple[
        str]

conf.py:

extensions = [
    'sphinx_automodapi.automodapi',
]

index.rst:

.. automodapi:: bar

After command PYTHONPATH=. sphinx-build -b html . html_python sphix-automodapi hangs with the following output:

PYTHONPATH=. sphinx-build  -b html . html_python
Running Sphinx v5.3.0+/a5588443
loading pickled environment... done
[autosummary] generating autosummary for: api/bar.Bar.rst, index.rst
[automodsumm] index.rst: found 1 automodsumm entries to generate
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: [extensions changed ('sphinx_automodapi.automodapi')] 2 added, 0 changed, 0 removed
reading sources... [ 50%] api/bar.Bar                   
@mikir mikir changed the title Freeze during generation of HTML of simple source Freeze during generation of HTML Oct 7, 2022
@pllim
Copy link
Member

pllim commented Oct 7, 2022

I am not sure if we ever updated this to work with annotation. Does it work if you use sphinx.ext.napoleon instead of this package?

@pllim pllim added the bug label Oct 7, 2022
@pllim pllim changed the title Freeze during generation of HTML Freeze during generation of HTML (with typing) Oct 7, 2022
@mikir
Copy link
Author

mikir commented Oct 7, 2022

Unfortunatelly it doesn't. sphinx.ext.napoleon gives the same result:

Running Sphinx v5.3.0+/61daeadb
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: [extensions changed ('sphinx.ext.napoleon')] 2 added, 0 changed, 0 removed
reading sources... [ 50%] api/bar.Bar

We use typing heavily and it works somehow but except of this construct.

Note: I found out that it hangs only if I ran the example with sphinx_automodapi.automodapi before. The reason is directory api generated by automodapi. If I remove this directory, sphinx.ext.napoleon does not hang.

@pllim
Copy link
Member

pllim commented Oct 7, 2022

If sphinx.ext.napoleon also hangs, probably an issue with Sphinx, and not just sphinx-automodapi? I would suggest you get a reproducible example without sphinx-automodapi and report that upstream. Our devs are not involved with Sphinx itself, unfortunately.

Also, how did you get Sphinx v5.3.0? They only have v5.2.3 right now according to https://github.com/sphinx-doc/sphinx/releases

@mikir
Copy link
Author

mikir commented Oct 7, 2022

OK, I'll report this upstream. Many thanks for such quick feedback.

Regarding Sphinx v5.3.0, I just installed the latest unreleased package using pip install git+https://github.com/sphinx-doc/sphinx.

@pllim

This comment was marked as outdated.

@Mi-La
Copy link

Mi-La commented Oct 11, 2022

Please see discussion here sphinx-doc/sphinx#10907. It seems that it is really related only to automodapi. With napoleon it works if you purge api directory generated by automodapi before run.

@pllim
Copy link
Member

pllim commented Oct 11, 2022

Oh, interesting. Thanks for reporting back!

@pllim
Copy link
Member

pllim commented Oct 11, 2022

Someone would have to spend some time debugging automodapi to see what exactly is causing this problem. Not sure if our core developers currently have time for this. So if you want to investigate and submit a patch, it would be greatly appreciated. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants