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

:attr: links to intersphinx-reachable properties are still broken #7183

Closed
flying-sheep opened this issue Feb 19, 2020 · 4 comments
Closed

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Feb 19, 2020

Describe the bug
#7061 contained a workaround to unbreak the bug where :attr: wasn’t able to refer to properties.

unfortunately the workaround doesn’t address intersphinx links, as intersphinx relies on the missing-reference hook to resolve references. The resolve_xref function containing the workaround always returns None for intersphinx links, and intersphinx’ missing-reference hook doesn’t contain a workaround.

#7068 is the correct fix for this problem that makes further workarounds unnecessary.

To Reproduce

echo >conf.py <<EOF
extensions = ["sphinx.ext.intersphinx"]
intersphinx_mapping = dict(pandas=("https://pandas.pydata.org/pandas-docs/stable/", None))
EOF
echo ':attr:`pandas.DataFrame.iloc`' >index.rst
sphinx build . html

Expected behavior

Environment info

  • OS: All
  • Python version: 3.8
  • Sphinx version: 2.4.1
  • Sphinx extensions: sphinx.ext.intersphinx
@flying-sheep
Copy link
Contributor Author

flying-sheep commented Feb 19, 2020

I would prefer if we just merge #7068 and forget that the whole thing happened. It’s already confusing enough that #7061 was merged and people can refer to properties using :meth: now and it’ll look completely nonsensical:

grafik

iloc and loc aren’t callable, those parentheses should not be there.

@tk0miya
Copy link
Member

tk0miya commented Feb 20, 2020

I'd not like to merge big changes into 2.4.x release. So I just made a small fix to patch intersphinx for :attr: role. I know this way is ugly, but...

@flying-sheep
Copy link
Contributor Author

I understand, I do however want to point out that e32a610 was a breaking change that went into 2.1.0. Merging #7068 (hopefully) won’t break anything, only deprecate things.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Feb 21, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this issue Feb 21, 2020
tk0miya added a commit that referenced this issue Feb 22, 2020
Fix #7183: intersphinx: ``:attr:`` reference to property is broken
@tk0miya
Copy link
Member

tk0miya commented Feb 22, 2020

Fixed by #7187
Thank you for reporting.
I'll start to review and consider design of #7068 later.

@tk0miya tk0miya closed this as completed Feb 22, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants