-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Restore linkcheck for specs #1950
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Filipe Laíns <[email protected]>
for more information, see https://pre-commit.ci
|
Wow, that's a nice idea. Might be useful as an external project too. Though, it looks like the linkcheck job is failing due to this? |
|
Looks like it's failing because linkcheck cannot resolve relative links to |
Signed-off-by: Filipe Laíns <[email protected]>
|
CI is passing now 😊 |
| >>> resolve_local_html_link('https://packaging.python.org/en/latest/specifications/schemas/') | ||
| '{srcdir}/specifications/schemas/index.rst' | ||
| >>> resolve_local_html_link('https://packaging.python.org/en/latest/specifications/schemas/build-details-v1.0.schema.json') | ||
| '{html_extra_path0}/specifications/schemas/build-details-v1.0.schema.json' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
| '{html_extra_path0}/specifications/schemas/build-details-v1.0.schema.json' | |
| '{html_extra_path}/specifications/schemas/build-details-v1.0.schema.json' |
This PR restores the
linkcheckfunctionality forhttps://packaging.python.org/en/latest/...links.It does so by adding a Sphinx plugin that hooks into the
linkcheck-process-urievent and replaces the original URLs with the corresponding local path.We've had a couple issues with schema links, which need to be specified via the full remote URL (eg. #1889 (comment)). We currently need to ignore them in
linkcheckas it fails to take into account local changes. With this PR, the ability to catch these issues during lint is restored.📚 Documentation preview 📚: https://python-packaging-user-guide--1950.org.readthedocs.build/en/1950/