-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Sphinx linkcheck and broken/redirect occurrences in Python Docs #103484
Comments
What about ignoring the 7824 bpo redirects? They work fine, we control bpo and can keep the redirector working, we don’t need to change 8000 lines in historical whatsnew docs. The CVS redirections can be fixed, as well as the broken links. |
(For reference, some earlier discussion at https://discuss.python.org/t/sphinx-linkcheck-and-broken-redirect-occurrences-in-python-docs/25687)
Yes, let's ignore the BPO redirects. There's so many, I think either We actually have a Line 258 in 7f3c106
Please could you give some examples of these?
If there's not too many, we could add to https://github.com/python/devguide/blob/79e1a1f2961ba0882d5f0274f7c8876e36ca5dff/conf.py#L60-L107
Not as such, although effort is usually prioritised for the newer/more active pages. Cleaning them up would mean linkcheck output is more useful in the future.
...
Maybe a PR for each of these steps? And split smaller if you feel they're too big. Smaller PRs are easier to review and get merged. |
Sure. The file Doc/about.rst has GitHub URL for browsing files is /blob/ and directories is /tree/. When browsing Misc/ACKS, the /tree/ redirects to /blob/. From linkcheck stdout:
See in the above log how the redirect was from /tree/ to /blob/.
Great, I'll focus on the cleanup then.
Will do, thanks for the suggestion. |
Thanks, we can add the tree->blob redirects to |
Why not do the one-line fix to pyspecific rather? |
Because in EDIT: See some examples: $ curl -sI https://github.com/python/cpython/blob/main/Misc | grep -E '(^HTTP|^location:)'
HTTP/2 301
location: https://github.com/python/cpython/tree/main/Misc
$ curl -sI https://github.com/python/cpython/tree/main/Misc/ACKS | grep -E '(^HTTP|^location:)'
HTTP/2 301
location: https://github.com/python/cpython/blob/main/Misc/ACKS |
Suggestion please?
The text talks about OpenSSL 1.1.0 and the URL for version 1.1.0 is broken (HTTP 404), but there are valid URLs for the same resource pointing to OpenSSL version 1.1.1 and to 3.1.0. Should I update the URL to either one, or use wayback machine to make sure to match the OpenSSL version? |
If openssl 1.1.1 is a bugfix release of the 1.1 branch, then it would be fine to point there. |
Created the first PR. I'm planning to create other 2 PRs, with more file changes than this one. |
I noticed the docs.yml workflow file runs for all branches from main to 3.7. Should I back-port the fixes to all these versions (cases were the bot won't be able to back-port automatically) or is there some code freeze that prevents it? |
Backporting doc fixes to 3.11 is fine, but older branches only accept security fixes. |
Got it. It means a linkcheck job in docs.yml will require a condition check to exclude versions < 3.11. Thanks. |
A workflow in the main branch applies to other branches?! What a strange system. |
Yep. It is a centralized way to control what routines will run in which events (push, pull requests, etc.) and in which branches. |
Are you sure? I made a test repo with Each branch has a workflow that does
A push to each branch echoes the matching version number. So it runs its own workflow, not the one from
Also, making branches from each, and a PR back, also echoes the matching version number, not the one from |
I was sure until now. I mean, what's the point of having branch filters with they don't actually filter on which branch a workflow can or cannot be run? on:
push:
branches:
- main
- '3.11'
- '3.10'
... |
I expect it's to have as few changes as possible between branches to make it easier for the bot to backport (and for humans when the bot can't do it). |
Well, I stand corrected. That means a linkcheck job will need to be added to both main and 3.11. No problem. |
…es (#103569) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
…st cases (pythonGH-103569) (cherry picked from commit f39e00f) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
We probably don't want to run linkcheck on the CI for a couple of reasons:
|
Fixes to broken links now submitted. |
* main: (24 commits) pythongh-98040: Move the Single-Phase Init Tests Out of test_imp (pythongh-102561) pythongh-83861: Fix datetime.astimezone() method (pythonGH-101545) pythongh-102856: Clean some of the PEP 701 tokenizer implementation (python#103634) pythongh-102856: Skip test_mismatched_parens in WASI builds (python#103633) pythongh-102856: Initial implementation of PEP 701 (python#102855) pythongh-103583: Add ref. dependency between multibytecodec modules (python#103589) pythongh-83004: Harden msvcrt further (python#103420) pythonGH-88342: clarify that `asyncio.as_completed` accepts generators yielding tasks (python#103626) pythongh-102778: IDLE - make sys.last_exc available in Shell after traceback (python#103314) pythongh-103582: Remove last references to `argparse.REMAINDER` from docs (python#103586) pythongh-103583: Always pass multibyte codec structs as const (python#103588) pythongh-103617: Fix compiler warning in _iomodule.c (python#103618) pythongh-103596: [Enum] do not shadow mixed-in methods/attributes (pythonGH-103600) pythonGH-100530: Change the error message for non-class class patterns (pythonGH-103576) pythongh-95299: Remove lingering setuptools reference in installer scripts (pythonGH-103613) [Doc] Fix a typo in optparse.rst (python#103504) pythongh-101100: Fix broken reference `__format__` in `string.rst` (python#103531) pythongh-95299: Stop installing setuptools as a part of ensurepip and venv (python#101039) pythonGH-103484: Docs: add linkcheck allowed redirects entries for most cases (python#103569) pythongh-67230: update whatsnew note for csv changes (python#103598) ...
…ythonGH-123019) (cherry picked from commit 1054a75) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Fix redirects reported by linkcheck, update docs conf.py checks.
…honGH-124144) Fix redirects reported by linkcheck, update docs conf.py checks. (cherry picked from commit 0a32c69) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
…honGH-124144) Fix redirects reported by linkcheck, update docs conf.py checks. (cherry picked from commit 0a32c69) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
) (cherry picked from commit ab80c6b) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
) (cherry picked from commit ab80c6b) Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Fixed by ab80c6b. Backports will follow. |
@vstinner I was hoping to include at least another PR for "redirect with found" reported by linkcheck, (see above comment #103484 (comment)), and then we can close this. Can you please keep this open for now? |
…honGH-124144) Fix redirects reported by linkcheck, update docs conf.py checks.
….rst (GH-124183) Relink _xxsubinterpretersmodule.c in whatsnew/3.12.rst
Running
make linkcheck
in Doc folder outputs thousands of broken and redirected status. It would be nice to clean this up so we can link-check Python in CI/CD for each commit, but right now it is too polluted.Some of these occurrences could/should be fixed in the docs itself, others can benefit from Sphinx's linkcheck configs e.g.
linkcheck_ignore
andlinkcheck_allow_redirect
.See linkcheck-log.txt for the full log as of commit f2b7ecb.
Fun stats obtained from the above file:
The way I see, this steps divide in:
linkcheck_allow_redirect and linkcheck_ignore can be very handy in this case. linkcheck_allow_redirect makes 'ok' status a redirect that is being spotted by linkcheck, and we have linkcheck_ignore as the last resource.
Questions I have before implementing the solution:
Linked PRs
The text was updated successfully, but these errors were encountered: