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

Sphinx class inheritance diagrams not linking classes correctly #4935

Closed
2 tasks
MSeifert04 opened this issue May 17, 2016 · 16 comments
Closed
2 tasks

Sphinx class inheritance diagrams not linking classes correctly #4935

MSeifert04 opened this issue May 17, 2016 · 16 comments

Comments

@MSeifert04
Copy link
Contributor

MSeifert04 commented May 17, 2016

Blocked by


In class inheritance diagrams the links to the classes are broken. For example here.

The problem seems to be that these links don't include the branch, for example:

Not sure if this is astropy related. If not could you point me in the right direction?

@bsipocz
Copy link
Member

bsipocz commented May 17, 2016

This is a duplicate for astropy/photutils#345. One fix was done in sphinx-doc/sphinx#2484, but there are issues with it and I haven't got time yet to get back to it. However it's on my list to do before 1.2.

@larrybradley
Copy link
Member

@bsipocz Any update on this?

@bsipocz
Copy link
Member

bsipocz commented May 16, 2017

@mirca @dpshelio - I can't remember whether you find any workarounds for this, or just the one I had the PR in sphinx?

@mirca
Copy link
Member

mirca commented May 16, 2017

@bsipocz We ended up implementing the same solution you thought.

@Cadair
Copy link
Member

Cadair commented May 16, 2017

Crikey have these really been broken for this long, shows you how much attention I pay.

@bsipocz
Copy link
Member

bsipocz commented May 16, 2017

@mirca - ouch, I though you've found a patch for https://github.com/astropy/sphinx-automodapi that would make it work again.

@amcnicho
Copy link

amcnicho commented Mar 5, 2020

I noticed another instance of this issue (docs/coordinates/index.rst is affected) and also realized that the links in the generated inheritance diagrams are only missing the branch name. I checked the build page and it seems that sphinx_automodapi is apparently run without graphviz explicitly installed:

python3.6 -mvirtualenv --system-site-packages /home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/latest 
/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/astropy/.cache/pip pip 
/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/astropy/.cache/pip -I Pygments==2.3.1 setuptools==41.0.1 docutils==0.14 mock==1.0.1 pillow==5.4.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.8.1 recommonmark==0.5.0 sphinx<2 sphinx-rtd-theme<0.5 readthedocs-sphinx-ext<1.1

This is contrary to instructions in the documentation, which state graphviz as a dependency for inheritance diagrams. Could a fix for this issue be as straightforward as updating the CI system to ensure that library is installed before documentation builds?

Update: I found that the graphviz system library is installed by the CI configuration but I still wonder whether the pip wheel should be installed (by adding it to the docs venv package list used by tox). The python version of the library does seem necessary based on my cursory examination of the relevant class in sphinx_automodapi.

@embray
Copy link
Member

embray commented Feb 2, 2022

Just rediscovered this issue when using Astropy as a nice demonstration of class inheritance diagrams. I can't believe this has been broken for 6 years 🤯

I'll have a look into it.

@ayshih
Copy link
Contributor

ayshih commented Jun 17, 2022

I've put up a PR (astropy/sphinx-automodapi#152) that finally fixes this bug

@ayshih
Copy link
Contributor

ayshih commented Jun 18, 2022

Upon further testing, I discovered that the true bug is in Sphinx after all, and has nothing to do with sphinx_automodapi. See sphinx-doc/sphinx#10576

@ayshih
Copy link
Contributor

ayshih commented Jun 19, 2022

I'll point out that even after Sphinx accepts the bugfix for current releases, the Astropy docs are currently being built against a rather old version of Sphinx. You'll almost certainly need to undo the sphinx<4 pin (see #11725) to get working inheritance diagrams.

@pllim
Copy link
Member

pllim commented Jun 20, 2022

Yeah, to unpin Sphinx, we also need to figure out astropy/sphinx-automodapi#150 from @saimn .

@pllim
Copy link
Member

pllim commented Dec 9, 2022

Update: We have unpinned Sphinx in #14140

@ayshih
Copy link
Contributor

ayshih commented Aug 10, 2023

The bug fixes have been merged upstream (sphinx-doc/sphinx#10614 and astropy/sphinx-automodapi#172), so will presumably show up in respective new releases, but there will potentially be an incompatibility between our theme and the next release of Sphinx (see pydata/pydata-sphinx-theme#1404).

@ayshih
Copy link
Contributor

ayshih commented Aug 19, 2023

It took over seven years, but this issue can finally be closed! Proof: https://docs.astropy.org/en/latest/time/ref_api.html#class-inheritance-diagram (which also correctly links to the Python docs if you click on the tzinfo box)

@pllim
Copy link
Member

pllim commented Aug 19, 2023

Thank you, @ayshih !!!

@pllim pllim closed this as completed Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants