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

Type annotation reference unclickable #12496

Open
oddbookworm opened this issue Jun 30, 2024 · 4 comments
Open

Type annotation reference unclickable #12496

oddbookworm opened this issue Jun 30, 2024 · 4 comments
Labels

Comments

@oddbookworm
Copy link

oddbookworm commented Jun 30, 2024

Describe the bug

In a very rare case, when I try to click on a reference in a type annotation, I get the following behavior:

Untitled.mp4

I stumbled upon this while playing around with fixing a multiple target warning because we have two classes with the same name (it's just that we're migrating from the old location to the new location and the one that sphinx links to is the deprecated version). I fixed that by qualifying specifically which version of the class I wanted to reference, but then this happens

How to Reproduce

Unfortunately, I don't have a standalone reproducer, so I'm just going to have to give a repo and stuff. I'm linking to a branch on my fork that has the fix I mentioned above. If you clone the upstream or any other branch, it'll just show the warning

git clone https://github.com/oddbookworm/pygame-ce
git checkout sphinx-warning
cd pygame-ce
python -m venv venv
# activate it, depending on OS
pip install sphinx
python buildconfig\make_docs.py full_generation
python -m docs
# navigate to ${repo_dir}/docs/generated/ref/display.html#pygame.display.message_box
    # i.e. if your browser opens at file:///C:/Users/andre/Projects/pygame-ce/docs/generated/index.html, replace `index.html` with `ref/display.html#pygame.display.message_box`
Try to hover over the `pygame.Window` annotation in the param list

edited since initial post to indicate the actual process for getting to the branch needed

Environment Information

Platform:              win32; (Windows-10-10.0.22631-SP0)
Python version:        3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)])
Python implementation: CPython
Sphinx version:        7.3.7
Docutils version:      0.21.2
Jinja2 version:        3.1.4
Pygments version:      2.18.0

Sphinx extensions

No response

Additional context

I tried on 3 browsers:
Chrome 126.0.6478.127
Edge 126.0.2592.81
Firefox 127.0.2

I was able to reproduce it on Chrome and Edge, but not Firefox. Of note is that Ff didn't show the tooltip about the class that is demo'd in the video

@electric-coder
Copy link

electric-coder commented Jun 30, 2024

I stumbled upon this while playing around with fixing a multiple target warning

If you have underlying errors there's no guarantee those won't cause strange behavior. Fixing the multiple target error should fix that bug. I can't recall seeing any mention of the error you're showing.

Unfortunately, I don't have a standalone reproducer

Not all is bad, at least you have a video! But you'd be surprised how many devs show up with a: "here repo - you fix!" attitude demanding someone fix their supposed "bug" when actually it's a basic error of their making. Anyway, call me an old timer but I don't clone repos. (And as all good old timers I'm grumpy and lazy on Sundays :D )

@oddbookworm
Copy link
Author

@electric-coder sorry I didn't see this sooner. After this change, the errors did go away. There are no other errors either

@AA-Turner
Copy link
Member

Hi Andrew, can this now be closed?

A

@oddbookworm
Copy link
Author

No, the purpose for this being open is the new problem. Fixing the multiple target warnings caused this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants