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

autodoc does not recognize cython_function_or_method #8074

Closed
McSinyx opened this issue Aug 8, 2020 · 4 comments
Closed

autodoc does not recognize cython_function_or_method #8074

McSinyx opened this issue Aug 8, 2020 · 4 comments

Comments

@McSinyx
Copy link
Contributor

McSinyx commented Aug 8, 2020

First of all, congratulations on the new release 3.2! I've been waiting for it for quite a while.

Describe the bug

When I try to build the HTML pages using make html, autodoc throw an exception about not expecting cython_function_or_method. On Sphinx 3.1.2 this doesn't happen.

To Reproduce

Steps to reproduce the behavior:

$ git clone --single-branch --branch gh-pages https://github.com/McSinyx/palace
$ cd palace
$ pip install palace==0.2.1 Sphinx==3.2.0
$ cd docs
$ make htmlRunning Sphinx v3.2.0
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 17 source files that are out of date
updating environment: [new config] 17 added, 0 changed, 0 removed
reading sources... [ 35%] reference/buffer                                                                                                                                      
Extension error:
Handler <function _process_docstring at 0x7f47a189c550> for event 'autodoc-process-docstring' threw an exception (exception: module, class, method, function, traceback, frame, or code object was expected, got cython_function_or_method)
make: *** [Makefile:20: html] Error 2

Currently palace only have binary builds for Python 3.6+ on GNU/Linux (and for Python 3.6 on macOS, but I doubt if anyone is still using Python 3.6 anymore), so if you don't have GNU/Linux I'll work out a more minimal Cython module to facilitate the debugging progress.

Your project

For convenience purposes, I'm leaving a snapshot of our project gh-pages branch here as well: palace-gh-pages.zip

Environment info

  • OS: Debian GNU/Linux testing
  • Python version: 3.8.5
  • Sphinx version: 3.2.0
  • Sphinx extensions: sphinx.ext.autodoc
  • Extra tools: Cython 0.29.21
@tk0miya
Copy link
Member

tk0miya commented Aug 8, 2020

Sorry for inconvience. I confirmed the error with following Dockerfile:

FROM python:3.8-slim

RUN apt update; apt install -y build-essential curl git make unzip vim
RUN git clone --single-branch --branch gh-pages https://github.com/McSinyx/palace
RUN pip install palace==0.2.1 Sphinx==3.2.0
RUN apt install -y libjack-dev libpulse-dev libasound-dev
WORKDIR /palace
RUN make html SPHINXOPTS=-T

It seems the bug was added by #7690 (cc: @keewis ). I'll try to fix it soon.

@McSinyx
Copy link
Contributor Author

McSinyx commented Aug 8, 2020

Thank you for the prompt response and I'm sorry for not providing sufficient information (about the napoleon plugin used and that palace needs an audio backend to be imported by autodoc) so that you had to figured it out yourself. The PR you linked looks awesome and I can't wait to try it out once this issue is resolved!

@tk0miya tk0miya closed this as completed in 51332c7 Aug 9, 2020
tk0miya added a commit that referenced this issue Aug 9, 2020
Fix #8074: napoleon: Crashes during processing C-ext module
@tk0miya tk0miya added this to the 3.2.1 milestone Aug 9, 2020
@tk0miya
Copy link
Member

tk0miya commented Aug 9, 2020

I merged #8077 now. I'll wait for another critical bug report to 3.2.0 for a while and release this as 3.2.1 within a week.

@McSinyx
Copy link
Contributor Author

McSinyx commented Aug 9, 2020

Thanks, I can confirm that it is working now!

jqmp added a commit to square/bionic that referenced this issue Aug 11, 2020
This version of Sphinx fails to build our docs with the following error:

    Handler <function _process_docstring at 0x7f156ef03598> for event
    'autodoc-process-docstring' threw an exception (exception: module,
    class, method, function, traceback, frame, or code object was expected,
    got PathProtocol)

This appears to be a bug in Sphinx which should be fixed in the next
version. (See [here](sphinx-doc/sphinx#8074)
for more details.) I've confirmed that the build works properly with
Sphinx master.
st-bender added a commit to st-bender/pynrlmsise00 that referenced this issue Aug 14, 2020
Sphinx 3.2.0 (on rtd) has a problem with cpython extensions,
disables that version when building the docs on rtd.

References:
* sphinx-doc/sphinx#8074
* sphinx-doc/sphinx#8077

[skip ci]
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 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

2 participants