readthedocs / readthedocs/sphinx-autoapi

`more than one target found for cross-reference` warning appeared after upgrading to `sphinx==5.2.3` and `sphinx-autoapi>=2.0.0`

Open
#357 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
494
Forks
147
Avg merge
9m
Merged PRs (30d)
1

Description

Hey! Our build is popping up a new warning after upgrading to the latest sphinx and autoapi.

/home/sam/Code/specs/autoapi_mre/doc/autoapi/file3/index.rst:33:more than one target found for cross-reference 'Transaction': file1.Transaction, file2.Transaction

Here's the setup:

file1.py

class Transaction:
    pass

file2.py

class Transaction:
    pass

file3.py

from typing import Union

Transaction = Union[int, str]


def foo(x: Transaction):
    pass

conf.py

project = "MRE"
copyright = "2021, Foo"
author = "Foo"

extensions = [
    "autoapi.extension",
]

autoapi_type = "python"
autoapi_dirs = ["../mre"]

templates_path = ["_templates"]

highlight_language = "python3"

add_module_names = False

autodoc_typehints = "signature"

exclude_patterns = []

html_theme = "alabaster"
html_static_path = []

Repro

You can find the whole repro here: https://github.com/SamWilsn/autoapi-mre

Build with: tox -e doc.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the warning with the linked MRE and tox -e doc, then inspect doc/conf.py and the generated doc/autoapi/file3/index.rst alongside the file1.py, file2.py, and file3.py examples. Trace how the Sphinx 5.2.3 and sphinx-autoapi 2.0.0 setup resolves the Transaction cross-reference; done means the reported regression is understood and the warning has a verified resolution or a focused regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.