GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-101100: Test docs in nit-picky mode by hugovk · Pull Request #102513 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented Mar 7, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This builds upon @encukou's encukou#21, see also https://discuss.python.org/t/broken-references-in-sphinx-docs/19463.

This adds two new parts to the docs CI.


1. Check files modified in PR

The files are touched and the Sphinx build re-ran. Sphinx only rebuilds the modified files so is quick. But this time we run Sphinx with the -n nit-picky mode enabled to be warned about extra documentation problems.

However, we don't let it fail the build: you may have modified a file that already has lots of issues, but didn't introduce any (or many) new ones.

But we do pipe the warnings through Doc/tools/warnings-to-gh-actions.py which uses GitHub's annotations feature to highlight where exactly the warning occurs. For example, see the demo at https://github.com/encukou/cpython/pull/21/files:

Screenshot image

2. Check hardcoded list of "known good files"

We want to make sure certain files have no warnings, and remain with no warnings. To begin with, only Doc/whatsnew/3.12.rst is in this list, but we will iteratively add more as we fix them, especially "important" files.

This time, we turn the warnings into errors with -W, because we don't want these files to regress.

For example, here's 3.12.rst failing: https://github.com/hugovk/cpython/actions/runs/4347385122/jobs/7595550243

Screenshot image

This PR then also fixes 3.12.rst so the CI passes.

TODO:

  • Once merged, backport exceptions (new in 3.12), weakref, asyncio-tasks and gzip docs to 3.11/3.10.
  • Issue: Fix all Sphinx reference warnings in the documentation #101100

Automerge-Triggered-By: GH:hugovk

Automerge-Triggered-By: GH:hugovk

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

m-aciek reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
encukou and others added 3 commits March 6, 2023 21:38
@encukou @hugovk
GHA, Docs: Add PR annotations for failed Sphinx references
ed0540b
@hugovk
GHA, Docs: Ensure some files always pass Sphinx nitpicks
4e2ef71
@hugovk
Fix Sphinx warnings in 'What's New In Python 3.12'
d1ce7f9
@hugovk
hugovk requested a review from ezio-melotti as a code owner March 7, 2023 21:50
@bedevere-bot bedevere-bot mentioned this pull request Mar 7, 2023
Fix all Sphinx reference warnings in the documentation #101100
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 7, 2023
@AlexWaygood AlexWaygood added the skip news label Mar 7, 2023
@hugovk
Use Ana06/get-changed-files to fix 'The head commit for this pull_req…
238dfc2
…uest event is not ahead of the base commit'

Re: jitterbit/get-changed-files#11
@hugovk
hugovk force-pushed the docs-nit-picky branch from de1e80b to 238dfc2 Compare March 7, 2023 22:06
CAM-Gerlach
CAM-Gerlach reviewed Mar 8, 2023
View reviewed changes

@CAM-Gerlach CAM-Gerlach left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

This is great; thanks @hugovk and @encukou ! I did have some comments; see below.

If adding back legitimate warnings for missing documentation results in the 3.12 What's New no longer being fully clean, you could add library/sqlite3.rst in its place, which Erlend and I have made sure should be clean (documenting what was missing, etc).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tools/warnings-to-gh-actions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tools/warnings-to-gh-actions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood AlexWaygood mentioned this pull request Mar 9, 2023
gh-91896: Deprecate collections.abc.ByteString #102096
Merged
hugovk
hugovk commented Mar 9, 2023
View reviewed changes
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk commented Mar 9, 2023
View reviewed changes
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk commented Mar 9, 2023
View reviewed changes
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

hugovk and others added 2 commits March 9, 2023 22:34
@hugovk @CAM-Gerlach
Apply suggestions from code review
b97f25b
Co-authored-by: C.A.M. Gerlach <[email protected]>
@hugovk
Document PyObject_ClearWeakRefs
1465769
@hugovk
hugovk force-pushed the docs-nit-picky branch from b187a44 to 1465769 Compare March 11, 2023 20:26
@merwok

merwok commented Mar 11, 2023

Copy link
Copy Markdown
Member

Python repos don’t use force pushes

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk @CAM-Gerlach
Document gzip's filename
460d83f
Co-authored-by: C.A.M. Gerlach <[email protected]>
@CAM-Gerlach

CAM-Gerlach commented Mar 12, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

In general, PR authors are discouraged from force-pushing once the PR is submitted to avoid making things more difficult for reviewers, but it's not an absolute blind ban—there's still some room for careful judgement, in specific situations where doing so does not conflict with, or in fact supports, the actual reasons for which we have that guideline, i.e. maximizing reviewability.

In particular, when we originally discussed this, it was agreed that it's fine to force-push before a draft PR is marked for review, as it can be a very helpful tool to organize a potentially very noisy initial commit history into an atomic, clearly-explained series of changes, which can greatly aid reviewability.

Likewise, it can potentially make sense and actually aid rather than hurt reviewability to amend a single commit immediately after pushing it to fix a small obvious typo introduced in that commit—which was the case here, with the fixup pushed less than 60 seconds after the original. There's little to no chance any reviewer would have seen, much less review/comment on the commit that quickly, thus there's minimal practical negative impact there. By contrast, it reduces unnecessary noise in the commit history and preserves a single atomic commit for reviewers to look at, without back-and-forth trivial fixups complicating things (which certainly make my life harder as a reviewer). And of course, you can still easily see both commits and compare them with one click if desired in the PR's full conversation history.

hugovk and serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Mar 22, 2023

Copy link
Copy Markdown
Member Author

Is there anything else needed here?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ezio-melotti
ezio-melotti approved these changes Mar 22, 2023
View reviewed changes

@ezio-melotti ezio-melotti left a comment

Copy link
Copy Markdown
Member

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.

Looks great!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Mar 22, 2023
CAM-Gerlach
CAM-Gerlach reviewed Mar 23, 2023
View reviewed changes
Comment thread .github/workflows/doc.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

CAM-Gerlach
CAM-Gerlach approved these changes Mar 23, 2023
View reviewed changes

@CAM-Gerlach CAM-Gerlach left a comment

Copy link
Copy Markdown
Member

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.

LGTM from me (minus a nit); thanks @hugovk

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk @CAM-Gerlach
Consistent quotes
bd7dbd6
Co-authored-by: C.A.M. Gerlach <[email protected]>
@hugovk hugovk added the 🤖 automerge label Mar 23, 2023
hugovk added 2 commits March 23, 2023 13:23
@hugovk
Merge remote-tracking branch 'upstream/main' into docs-nit-picky
15b6b1b
@hugovk
Fix reference warnings to removed opcodes
dded66d
@hugovk
hugovk requested review from 1st1, asvetlov, gvanrossum and kumaraditya303 as code owners March 23, 2023 21:18
@hugovk
hugovk removed request for 1st1, asvetlov, gvanrossum and kumaraditya303 March 23, 2023 21:47
@hugovk

hugovk commented Mar 23, 2023

Copy link
Copy Markdown
Member Author

Fixed and all green now!

  • PyErr_DisplayException was documented, but the markup was broken
  • PyErr_Display isn't documented, but it's deprecated, so let's skip the reference via !
  • asyncio.iscoroutine wasn't yet documented, but is now
CAM-Gerlach reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Merge branch 'main' into docs-nit-picky
742e29a
@hugovk hugovk added the 🤖 automerge label Mar 24, 2023
@miss-islington

miss-islington commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

Status check is done, and it's a success ✅.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Mar 24, 2023

Copy link
Copy Markdown
Member Author

Thanks for checking Miss Islington! Shouldn't you automerge too?

AlexWaygood reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
hugovk merged commit 6a1c49a into python:main Mar 24, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 24, 2023
@hugovk
hugovk deleted the docs-nit-picky branch March 24, 2023 11:23
@CAM-Gerlach

CAM-Gerlach commented Mar 24, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Maybe its time to just switch to regular GitHub automerge? Is there a reason to still use the old system?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Mar 24, 2023
[3.11] gh-101100: Document PyObject_ClearWeakRefs, gzip's name, and asyncio.iscoroutine #103001
Merged
[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name #103002
Merged
@hugovk

hugovk commented Mar 24, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Yeah, it's time! Please could you create a https://github.com/python/core-workflow/ issue? We'll need to coordinate deleting some https://github.com/python/miss-islington code.


TODO:

  • Once merged, backport exceptions (new in 3.12), weakref, asyncio-tasks and gzip docs to 3.11/3.10.

Backport PRs:

  • [3.11] gh-101100: Document PyObject_ClearWeakRefs, gzip's name, and asyncio.iscoroutine #103001
  • [3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name #103002
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAM-Gerlach

CAM-Gerlach commented Mar 24, 2023

Copy link
Copy Markdown
Member

Sure, I opened python/core-workflow#498 .

We'll need to coordinate deleting some python/miss-islington code.

The code might still be needed to support automerge-by-default for miss-islington PRs, if GItHub's API doesn't have a way for her to enable it when she makes them. But I discussed that further on the issue.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@CAM-Gerlach CAM-Gerlach mentioned this pull request Mar 24, 2023
Consider switching to native GitHub automerge python/core-workflow#498
Closed
@brandtbucher

brandtbucher commented Mar 24, 2023

Copy link
Copy Markdown
Member

I think this check now breaks when encountering NEWS entries in the Core and Builtins directory:

Error: One of your files includes a space. Consider using a different output format or removing spaces from your filenames. Please submit an issue on this action's GitHub repo.
Error: One of your files includes a space. Consider using a different output format or removing spaces from your filenames.
All: Doc/includes/typestruct.h Include/cpython/object.h Include/internal/pycore_code.h Include/internal/pycore_opcode.h Lib/importlib/_bootstrap_external.py Lib/opcode.py Lib/test/test_dis.py Lib/test/test_sys.py Misc/NEWS.d/next/Core and Builtins/2023-03-23-22-31-15.gh-issue-93533.RyrB_g.rst Objects/typeobject.c Programs/test_frozenmain.h Python/bytecodes.c Python/generated_cases.c.h Python/opcode_metadata.h Python/specialize.c
Added: Misc/NEWS.d/next/Core and Builtins/2023-03-23-22-31-15.gh-issue-93533.RyrB_g.rst
Modified: Doc/includes/typestruct.h Include/cpython/object.h Include/internal/pycore_code.h Include/internal/pycore_opcode.h Lib/importlib/_bootstrap_external.py Lib/opcode.py Lib/test/test_dis.py Lib/test/test_sys.py Objects/typeobject.c Programs/test_frozenmain.h Python/bytecodes.c Python/generated_cases.c.h Python/opcode_metadata.h Python/specialize.c
Removed: 
Renamed: 
Added or modified: Doc/includes/typestruct.h Include/cpython/object.h Include/internal/pycore_code.h Include/internal/pycore_opcode.h Lib/importlib/_bootstrap_external.py Lib/opcode.py Lib/test/test_dis.py Lib/test/test_sys.py Misc/NEWS.d/next/Core and Builtins/2023-03-23-22-31-15.gh-issue-93533.RyrB_g.rst Objects/typeobject.c Programs/test_frozenmain.h Python/bytecodes.c Python/generated_cases.c.h Python/opcode_metadata.h Python/specialize.c
Added, modified or renamed: Doc/includes/typestruct.h Include/cpython/object.h Include/internal/pycore_code.h Include/internal/pycore_opcode.h Lib/importlib/_bootstrap_external.py Lib/opcode.py Lib/test/test_dis.py Lib/test/test_sys.py Misc/NEWS.d/next/Core and Builtins/2023-03-23-22-31-15.gh-issue-93533.RyrB_g.rst Objects/typeobject.c Programs/test_frozenmain.h Python/bytecodes.c Python/generated_cases.c.h Python/opcode_metadata.h Python/specialize.c
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk mentioned this pull request Mar 24, 2023
gh-101100: Test only Doc/ files in nit-picky mode #103019
Merged
@hugovk

hugovk commented Mar 24, 2023

Copy link
Copy Markdown
Member Author

Please see PR #103019.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Mar 27, 2023

Copy link
Copy Markdown
Member

PyErr_Display isn't documented, but it's deprecated, so let's skip the reference via !

I don't think this is good general policy. Someone encountering a deprecated function in code they inherited should be able to find out what it does and what to use instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@hugovk @CAM-Gerlach
@encukou @Fidget-Spinner
pythongh-101100: Test docs in nit-picky mode (python#102513)
bf3bfdb
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@hugovk @CAM-Gerlach
@encukou @warsaw
pythongh-101100: Test docs in nit-picky mode (python#102513)
564b48e
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
@AlexWaygood AlexWaygood mentioned this pull request Apr 26, 2023
Running the Docs workflow via workflow_dispatch always fails #103884
Closed
@CAM-Gerlach CAM-Gerlach mentioned this pull request Aug 16, 2023
gh-101100: Only show GitHub check annotations on changed doc paragraphs #108065
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merwok merwok merwok left review comments
@CAM-Gerlach CAM-Gerlach CAM-Gerlach approved these changes
@AlexWaygood AlexWaygood AlexWaygood left review comments
@ezio-melotti ezio-melotti ezio-melotti approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@hugovk @merwok @CAM-Gerlach @miss-islington @brandtbucher @encukou @ezio-melotti @AlexWaygood @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.