Skip to content

Wrong URL for external package cross-reference #32

@jaywonchung

Description

@jaywonchung

Describe the bug
A cross reference to torch.utils.data.DataLoader is rendered with incorrect links.
Screen Shot 2022-08-04 at 12 29 12 PM
Here, torch points to https://pytorch.org/docs/1.10.1/data.html#module-torch.utils.data. data and DataLoader point to correct URLs.

I opened up the objects.inv file provided by PyTorch with Inventory.parse_sphinx and found that it does not have entries for torch and torch.utils. In such a case, I think torch should not point to anything like how torch.utils is not linked to anything.

To Reproduce

# test.py
import torch.utils.data

class MyDataLoader(torch.utils.data.DataLoader):
    pass
<!-- docs/index.md -->
::: test.MyDataLoader
# mkdocs.yml
site_name: Test

theme:
  name: material

plugins:
  - mkdocstrings:
      handlers:
        python:
          import:
            - https://pytorch.org/docs/1.10.1/objects.inv

nav:
  - Home: index.md

System:

  • mkdocstrings-python version: 0.7.1
  • Python version: 3.9.12
  • OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions