Skip to content

sphinx.ext.viewcode could not work as expected on parallel build #8933

@cheekyshibe

Description

@cheekyshibe

Describe the bug
I'm using sphinx to build the document for the project MegEngine.

In Docs repo, most APIs are organized manually for some reasons:

.. autosummary::
   :toctree: api
   :nosignatures:

   cos
   sin
   tan
   acos
   asin
   atan
   atan2
   cosh
   sinh
   tanh
   acosh
   asinh
   atanh

As you can see, several functions are implemented here:

WeChat3bebe346a97db2dad70a63161e7f0ff9

Everything works for cosh():

WeChata2050cf6586bb572655ecd991b785331

WeChate65d067246afe5f0d378e5776c672f1d

WeChat91eaedabab3eb86bbf83a80dc7574b44

But it doesn't work for some other APIs like asin() acos() ...

Seems viewcode-back class is not generated for every API.

To Reproduce

I'm sure that sphinx.ext.viewcode not works as expected.
You can do it with these steps to reproduce the behavior with a GitHub workflow file: https://github.com/MegEngine/Tutorials/blob/main/.github/workflows/sphinx-build.yml

Expected behavior
copied Class/Function source codes HTML pages can be highlighted and add links to documents correctly.

Your project
MegEngine / Docs

Environment info

  • OS: Ubuntu 18.04
  • Python version: 3.6/3.7
  • Sphinx version: sphinx-build 3.5.1
  • Sphinx extensions: sphinx.ext.viewcode
  • Extra tools: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensions:viewcodeThe `sphinx.ext.linkcode` or `sphinx.ext.viewcode` extensionstype:bug

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions