-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Milestone
Description
Hello everyone,
Describe the bug
After upgrading to 4.0.0 we have discovered that existing code is raising a warning with more than one target found for cross-reference
. In 3.5.4 we did not see this warning
To Reproduce
I have set up a minimal reproduction repository here: https://github.com/felixhuettner/sphinx-duplicate-import-repoduction
Steps to reproduce the behavior:
$ git clone https://github.com/felixhuettner/sphinx-duplicate-import-repoduction
$ cd sphinx-duplicate-import-repoduction
$ pip install -e .
$ pip install sphinx
$ cd docs
$ sphinx-build -W . _build
Output of the sphinx-build command:
❯ sphinx-build -W . _build
Running Sphinx v4.0.0+/acf66bc4d
making output directory... done
[autosummary] generating autosummary for: index.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
Warning, treated as error:
..../sphinxtest/test/file2.py:docstring of test.file2.SomeClass.somemethod::more than one target found for cross-reference 'TestError': test.TestError, test.file1.TestError
Expected behavior
no warning appears
Your project
https://github.com/felixhuettner/sphinx-duplicate-import-repoduction
Environment info
- OS: Linux
- Python version: 3.9.4
- Sphinx version: 4.0.0
- Sphinx extensions: sphinx.ext.autosummary
Additional context
I have bisected the issue to be introduced by acf66bc
Thanks verry much