Skip to content

Conversation

hoefling
Copy link
Member

This PR replaces referencing PyPI packages via hardcoded URLs to https://pypi.org/project/ by using sphinx.ext.extlinks plugin.

Old usage example:

`pytest <https://pypi.org/project/pytest>`__

New usage replacement:

:pypi:`pytest`

This PR partially addresses #9081.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Hi @hoefling,

Thanks for the contribution, that looks neat.

However looking at the generated docs, I see things are not rendering correctly:

image

(The link points to the correct location though).

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
@hoefling
Copy link
Member Author

@nicoddemus good catch! I've used sphinx master to test stuff out in a previous PR and forgot to revert it to the one in doc/en/requirements.txt. The changes in last commit amend that.

@hoefling hoefling requested a review from nicoddemus October 22, 2021 11:26
@hoefling
Copy link
Member Author

Can be also verified by looking at the plugin list, the prefix is no longer there. It will be necessary later on though, when the doc build switches to Sphinx 5 :-)

@nicoddemus
Copy link
Member

Thanks for the quick fix!

Can be also verified by looking at the plugin list, the prefix is no longer there. It will be necessary later on though, when the doc build switches to Sphinx 5 :-)

Not sure I follow, I still see it incorrectly rendered (also in other places), could you clarify?

@hoefling
Copy link
Member Author

@nicoddemus also on hard reload/in private window? Might be a simple cache issue.

@nicoddemus
Copy link
Member

Ahh sorry you are right, I didn't realize it was the same URL as before (RTD generates a unique URL per PR, and not per build as I assumed, which now that I actually think about it makes total sense).

Looks great, thanks a lot!

@nicoddemus nicoddemus changed the title replace hardcoded links to PyPI with extlinks Replace hardcoded links to PyPI with extlinks Oct 22, 2021
@nicoddemus nicoddemus merged commit 1e9e16d into pytest-dev:main Oct 22, 2021
@hoefling hoefling deleted the doc/extlinks-pypi branch October 22, 2021 15:52
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.

2 participants