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

Cython modules that use __init__.pyx instead of __init__.py are broken with sphinxcontrib.apidoc #6327

Closed
ghost opened this issue Apr 30, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 30, 2019

Describe the bug
Cython modules that use __init__.pyx/__init__.so instead of __init__.py are broken with sphinxcontrib.apidoc. They appear to be not picked up correctly by whatever internal component that uses (apidoc or autodoc I assume) and it gives a strange listing of the parent folder of the module only

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/wobblui/wobblui ./testblah
$ cd testblah/docs
$ make html
$ # open ./build/html/reference/modules.html and see it lists the "src" folder instead of the "wobblui" module

Expected behavior
docs/build/html/reference/modules.html will list "wobblui" module after docs build (that DOES happen by the way if you touch src/wobblui/__init__.py, but of course that breaks the module and the functions in src/wobblui/__init__.pyx may not be documented properly)

Your project
https://github.com/wobblui/wobblui (docs are inside "docs" folder, try "make html" as in steps above)

Screenshots
brokendocs

Environment info

  • OS: Linux
  • Python version: 3.7.3
  • Sphinx version: sphinx-quickstart --version says 1.7.6
  • Sphinx extensions: sphinxcontrib.apidoc should be the relevant one
  • Extra tools: none that I'm aware of(?)

Additional context
I already filed a ticket here: sphinx-contrib/apidoc#13 and it was suggested that the problem is probably in sphinx itself or apidoc/autodoc

@ghost ghost added the type:bug label Apr 30, 2019
@tk0miya tk0miya added this to the 2.1.0 milestone May 1, 2019
@ghost
Copy link
Author

ghost commented May 11, 2019

Is anyone aware of a workaround? Other than just adding an __init__.py file which doesn't fully do the job since then the __init__.pyx won't get documented (but at least the other modules will I suppose). I would also be interested in trying out any dev version of sphinx with an experimental change to improve this

@tk0miya
Copy link
Member

tk0miya commented May 12, 2019

Unfortunately, current implementation of apidoc only refers __init__.py. So we need to modify apidoc to do that. But I'm not familiar with apidoc. So it is a bit tough work to me...

@tk0miya tk0miya modified the milestones: 2.1.0, 2.2.0 May 31, 2019
@tk0miya tk0miya modified the milestones: 2.2.0, 2.3.0 Aug 18, 2019
@tk0miya tk0miya modified the milestones: 2.3.0, 2.4.0 Dec 8, 2019
tk0miya added a commit to tk0miya/sphinx that referenced this issue Feb 8, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Feb 8, 2020
tk0miya added a commit that referenced this issue Feb 9, 2020
Fix #6327: apidoc: Support a python package consisted of __init__.so file
@tk0miya
Copy link
Member

tk0miya commented Feb 9, 2020

Fixed by #7113
Thank you for reporting

@tk0miya tk0miya closed this as completed Feb 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 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

1 participant