diff --git a/conf.py b/conf.py index df7dfbaff1..c899822f83 100644 --- a/conf.py +++ b/conf.py @@ -44,6 +44,30 @@ # Set to '' to prevent appending "documentation" to the site title html_title = "" +linkcheck_allowed_redirects = { + # Edit page + r"https://docs.google.com/document/d/.*/": r"https://docs.google.com/document/d/.*/edit", + # Canonical + r"https://docs.python.org/": r"https://docs.python.org/3/", + # Translations with country codes + r"https://docs.python.org/[a-z-]+/": r"https://docs.python.org/[a-z-]+/3/", + # Personal /my/ links redirect to login page + r"https://discuss.python.org/my/.*": r"https://discuss.python.org/login-preferences", + # Login page + r"https://github.com/python/core-workflow/issues/new.*": r"https://github.com/login.*", + # Archive redirect + r"https://github.com/python/cpython/archive/main.zip": r"https://codeload.github.com/python/cpython/zip/refs/heads/main", + # Blob to tree + r"https://github.com/python/cpython/blob/.*": r"https://github.com/python/cpython/tree/.*", + # HackMD shortcuts + r"https://hackmd.io/s/.*": r"https://hackmd.io/@.*", + # Read the Docs + r"https://virtualenv.pypa.io/": r"https://virtualenv.pypa.io/en/latest/", + r"https://www.sphinx-doc.org/": r"https://www.sphinx-doc.org/en/master/", + # Cookie consent + r"https://www.youtube.com/playlist.*": r"https://consent.youtube.com/ml.*", +} + # ignore linkcheck anchors for /#/$ANCHOR since it is used for # dynamic pages such as http://buildbot.python.org/all/#/console # http://www.sphinx-doc.org/en/stable/config.html?highlight=linkcheck#confval-linkcheck_anchors_ignore @@ -51,6 +75,24 @@ # match any anchor that starts with a '/' since this is an invalid HTML anchor r'\/.*', ] + +linkcheck_ignore = [ + # The voters repo is private and appears as a 404 + 'https://github.com/python/voters/', + # The python-core team link is private, redirects to login + 'https://github.com/orgs/python/teams/python-core', + # The Discourse groups are private unless you are logged in + 'https://discuss.python.org/groups/staff', + 'https://discuss.python.org/groups/moderators', + 'https://discuss.python.org/groups/admins', + # The crawler gets "Anchor not found" for GitHub anchors + r'https://github.com.+?#L\d+', + r'https://github.com/cli/cli#installation', + r'https://github.com/github/renaming#renaming-existing-branches', + # Discord doesn't allow robot crawlers: "403 Client Error: Forbidden" + r'https://support.discord.com/hc/en-us/articles/219070107-Server-Nicknames', +] + rediraffe_redirects = { "clang.rst": "advanced-tools/clang.rst", "coverity.rst": "advanced-tools/coverity.rst", @@ -90,17 +132,6 @@ "triaging.rst": "triage/triaging.rst", } -linkcheck_ignore = [ - # The voters repo is private and appears as a 404 - 'https://github.com/python/voters/', - # The python-core team link is private, redirects to login - 'https://github.com/orgs/python/teams/python-core', - # The Discourse groups are private unless you are logged in - 'https://discuss.python.org/groups/staff', - 'https://discuss.python.org/groups/moderators', - 'https://discuss.python.org/groups/admins', -] - intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), } diff --git a/getting-started/pull-request-lifecycle.rst b/getting-started/pull-request-lifecycle.rst index bb685e21b7..e6be00c29f 100644 --- a/getting-started/pull-request-lifecycle.rst +++ b/getting-started/pull-request-lifecycle.rst @@ -343,7 +343,7 @@ Here are the steps needed in order to sign the CLA: .. _PSF license: https://docs.python.org/dev/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python .. _contributor agreement: https://www.python.org/psf/contrib/ .. _contributor form: https://www.python.org/psf/contrib/contrib-form/ -.. _Python Software Foundation: https://www.python.org/psf/ +.. _Python Software Foundation: https://www.python.org/psf-landing/ Submitting