Skip to content

use intersphinx crossrefs to stdlib docs where possible instead of hardcoded URLs #9041

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

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

hoefling
Copy link
Member

This PR replaces hardcoded links to docs.python.org by intersphinx crossrefs where possible. The only URL that was left hardcoded is in how-to/unittest.rst, since the referenced section in stdlib docs (link) doesn't have any label.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@Zac-HD
Copy link
Member

Zac-HD commented Sep 7, 2021

Thanks for catching this! Should we consider adding a CI check (git grep ...?) to make sure we don't introduce new cases?

We might also consider using extlinks so that we can write :issue:'1234' instead of the long link syntax (Hypothesis example), but IMO that's a separate PR.

@hoefling
Copy link
Member Author

hoefling commented Sep 7, 2021

@Zac-HD

Should we consider adding a CI check (git grep ...?) to make sure we don't introduce new cases?

Good idea! I'm using an extra sphinx builder (similar to linkcheck builder) for that in my projects, which checks all hardcoded links against hosts in intersphinx_mapping. Can add another PR that introduces this. IIRC there are also cases where hardcoded links can be replaced by intersphinx mappings that should be added first (e.g. refs to attrs or setuptools), but I didn't want to bloat the PR up any more.

We might also consider using extlinks

Yep, totally 👍

@RonnyPfannschmidt
Copy link
Member

lovely ideas, they will make fine follow-ups
do you want to create issues for them?

@Zac-HD
Copy link
Member

Zac-HD commented Sep 7, 2021

Issue opened! I particularly want to hear more about the builder; that sounds like a trick I'll want to copy for Hypothesis.

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

Successfully merging this pull request may close these issues.

3 participants