You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sphinx emits a "More than one target found" warning when resolving :any: crossrefs even if all targets actually point to the same place, which can happen e.g. if documenting a class implemented in a private module but reexported in a public one.
How to Reproduce
In an empty directory:
mkdir pkg
echo'from ._implementation import Foo; __all__ = ["Foo"]'>pkg/__init__.py
echo'class Foo: """The Foo."""'>pkg/_implementation.py
sphinx-apidoc . -o doc -F -A me -V 0.0
echo$'\nThe `pkg.Foo` is also the `pkg._implementation.Foo` and also the `Foo`.'>>doc/index.rst
(cd doc; PYTHONPATH=.. make O=-Ddefault_role=any html)
emits
.../doc/index.rst:23: WARNING: more than one target found for 'any' cross-reference 'Foo': could be :py:class:`pkg.Foo` or :py:class:`pkg._implementation.Foo`
even though there's only one entry for pkg.Foo in the docs (and pkg._implementation.Foo also points there).
Expected behavior
No warning.
Your project
N/A, see script above to generate it.
Screenshots
No response
OS
linux
Python version
3.9
Sphinx version
4.1.2
Sphinx extensions
autodoc
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hey @anntzer ! I've made a PR that I believe fixes your issue as well as mine (well... I think it's the same issue). Would you mind testing on branch ewjoachim:py-domain-canonical-any-10088 (gh pr checkout 10089 if you use gh) and confirm that it solves the issue for you ? if so we may close one of the tickets :)
Describe the bug
Sphinx emits a "More than one target found" warning when resolving
:any:
crossrefs even if all targets actually point to the same place, which can happen e.g. if documenting a class implemented in a private module but reexported in a public one.How to Reproduce
In an empty directory:
emits
even though there's only one entry for pkg.Foo in the docs (and pkg._implementation.Foo also points there).
Expected behavior
No warning.
Your project
N/A, see script above to generate it.
Screenshots
No response
OS
linux
Python version
3.9
Sphinx version
4.1.2
Sphinx extensions
autodoc
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: