Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong URL for external package cross-reference #32

Closed
jaywonchung opened this issue Aug 4, 2022 · 1 comment
Closed

Wrong URL for external package cross-reference #32

jaywonchung opened this issue Aug 4, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jaywonchung
Copy link

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
@pawamoy
Copy link
Member

pawamoy commented Nov 22, 2022

Hi @jaywonchung, sorry for the late reply and thank you for the report. I'll eventually get time to investigate and fix this issue :)

@pawamoy pawamoy added the bug Something isn't working label Mar 5, 2023
pawamoy added a commit to mkdocstrings/griffe that referenced this issue Jul 13, 2023
Previously `import a.b.c` was creating an alias
with name `a` pointing to `a.b.c`.
Now it creates an alias with name `a`
pointing to `a`.
We don't care about the nested attributes.

Issue mkdocstrings/python#32: mkdocstrings/python#32
@pawamoy pawamoy closed this as completed Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants