sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Regression in dependencies using autodoc/autosummary

Open mgeier opened this issue 3 years ago • 0 comments

Describe the bug

Recently, the unit tests of my project https://github.com/mgeier/sphinx-last-updated-by-git started to fail because Sphinx has changed the way how some dependencies of source files are determined.

I don't know whether this is intentional or an unwanted regression!

How to Reproduce

$ git clone https://github.com/mgeier/test-repo-for-sphinx-last-updated-by-git.git
$ cd test-repo-for-sphinx-last-updated-by-git

Open conf.py and remove the line with 'sphinx_last_updated_by_git'.

Add this to conf.py:

def _env_updated(app, env):
    print(env.dependencies['index'])
    exit()

def setup(app):
    app.connect('env-updated', _env_updated)

If you want to see the HTML output, you should also remove this line (and the exit() above):

templates_path = ['_templates']

After all those changes, run Sphinx:

$ python3 -m sphinx . _build -E

The last line of output will show the dependencies of index.rst:

{'example_module.py'}

Expected behavior

With Sphinx 4.5.0 and before, there were no dependencies:

set()

Your project

https://github.com/mgeier/test-repo-for-sphinx-last-updated-by-git

Sphinx version

ab3b3e298000c08ab0d0e354a0415df0af6d4e17

Sphinx extensions

sphinx.ext.autosummary

Additional context

I've bisected the change to commit ab3b3e298000c08ab0d0e354a0415df0af6d4e17, which is part of #10337, created by @AA-Turner.

mgeier avatar Jul 22 '22 20:07 mgeier