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

Autosummary fails on NumPy with 3.4.0 #8566

Closed
mattip opened this issue Dec 21, 2020 · 4 comments
Closed

Autosummary fails on NumPy with 3.4.0 #8566

mattip opened this issue Dec 21, 2020 · 4 comments

Comments

@mattip
Copy link

mattip commented Dec 21, 2020

The new 3.4.0 release does not properly import in autosummary docstrings. We get lots of errors like

/home/matti/miniconda3/envs/test/lib/python3.8/site-packages/numpy/__init__.py:docstring of numpy.bool_.rst:62: \
    WARNING: autosummary: failed to import astype

To Reproduce
checkout numpy, pip install cython; pip install .; pip install -r doc_requirements.txt; cd doc; make html

<Paste your command-line here which cause the problem>

$ git clone https://github.com/numpy/numpy
$ cd numpy
$ pip install cython .; # note the "."
$ pip install -r doc_requirements.txt
$ cd doc
$ make html 

Expected behavior
3.3.1 worked fine. 3.4.0 fails with many fail to import ... and then

/home/matti/miniconda3/envs/test/lib/python3.8/site-packages/numpy/__init__.py:docstring of numpy.bool_.rst:62: \
     WARNING: autosummary: stub file not found 'numpy.all'. Check your autosummary_generate setting.

Here is the complete log

log.txt

@tk0miya tk0miya added this to the 3.4.1 milestone Dec 21, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 23, 2020
…s classes

On the refactoring of Documenter.add_content() method, the
autodoc-process-docstring event is emitted to the alias classes (called
as doc_as_attr in our code) unexpectedly.  Before the change, it has
never been emitted.

The event causes that extensions (ex. numpydoc) confused.  So this
reverts the change temporarily (during 3.4.x).
tk0miya added a commit to tk0miya/sphinx that referenced this issue Dec 23, 2020
…s classes

On the refactoring of Documenter.add_content() method, the
autodoc-process-docstring event is emitted to the alias classes (called
as doc_as_attr in our code) unexpectedly.  Before the change, it has
never been emitted.

The event causes that extensions (ex. numpydoc) confused.  So this
reverts the change temporarily (during 3.4.x).

refs: sphinx-doc#8533
@tk0miya
Copy link
Member

tk0miya commented Dec 23, 2020

Finally, I found this bug came from the bug of autodoc. On my local, #8581 resolves this issue.

Note: reproducible Dockerfile

FROM python:3.8-slim

RUN apt update; apt install -y build-essential curl git make unzip vim
RUN git clone https://github.com/numpy/numpy
WORKDIR /numpy
RUN pip install cython .; # note the "."
RUN pip install -r doc_requirements.txt
RUN pip install git+https://github.com/tk0miya/sphinx@8566_autodoc_process_docstring_for_alias_classes
WORKDIR /numpy/doc
RUN make html

@jorisvandenbossche
Copy link
Contributor

With pandas we had the same issue (see #8533 (comment)), and I can confirm that #8581 fixes it.

Thanks for the quick follow-up!

@tk0miya
Copy link
Member

tk0miya commented Dec 24, 2020

@jorisvandenbossche Thank you for confirmation!

tk0miya added a commit that referenced this issue Dec 24, 2020
…for_alias_classes

Fix #8566: autodoc-process-docstring is emitted to the alias classes
@tk0miya tk0miya closed this as completed Dec 24, 2020
@mattip
Copy link
Author

mattip commented Dec 28, 2020

Thanks for the fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants