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-141004: Improve `make check-c-api-docs` by encukou · Pull Request #143564 · python/cpython

Conversation

@encukou

@encukou encukou commented Jan 8, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Gather all documented names into a set in a single pass. This makes the check much faster.

  • Do not match substrings (e.g. documenting PyErr_WarnEx doesn't mean that PyErr_Warn is documented)

  • Consider PY-prefixed names (a lot of old macros use this)

  • Issue: Document the entire C API #141004

Sorry, something went wrong.

Uh oh!

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

All reactions
encukou added 2 commits January 8, 2026 14:43
@encukou
pythongh-141004: check-c-api-docs: Gather names from ReST upfront
fde50f0
This makes the check much faster.
It also found 4 additional undocumented APIs, as it does not
match substrings (e.g. documenting `PyErr_WarnEx` doesn't
mean that `PyErr_Warn` is documented)
@encukou
Consider macros with the PY prefix
22e413d
@encukou
encukou requested a review from ZeroIntensity as a code owner January 8, 2026 14:02
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 8, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jan 8, 2026
Document the entire C API #141004
Closed
@ZeroIntensity ZeroIntensity added the skip news label Jan 8, 2026
ZeroIntensity
ZeroIntensity reviewed Jan 8, 2026
View reviewed changes

@ZeroIntensity ZeroIntensity 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.

Thanks, this looks pretty good as-is.

One extra thing I would like to do is run the script on docs PRs, since a name being documented while also being in ignored_c_api.txt will cause it to fail. So, if someone merges new documentation without updating ignored_c_api.txt, we'll see blocking failures on all C code PRs until we fix it. I haven't looked too closely at the GHA for change detection, but if you see an easy way to do that, would you mind doing it in this PR?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Tools/check-c-api-docs/main.py Resolved

Uh oh!

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

@encukou

encukou commented Jan 8, 2026

Copy link
Copy Markdown
Member Author

I'm not much of a GHA expert, so I'd leave changes to that to a separate PR.
(If we do that, we should take the names from the newly-built Intersphinx inventory, rather than parse the .rst. I can do the parsing; the GHA integration is intimidating.)

All reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity
ZeroIntensity approved these changes Jan 8, 2026
View reviewed changes

@ZeroIntensity ZeroIntensity 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.

Ok, let's just merge this as-is.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 8, 2026
@ZeroIntensity ZeroIntensity added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Jan 8, 2026
@StanFromIreland StanFromIreland mentioned this pull request Jan 8, 2026
gh-141004: GHA: Run check-c-api-docs check on docs-only PRs #143573
Merged
@StanFromIreland

StanFromIreland commented Jan 8, 2026

Copy link
Copy Markdown
Member

One extra thing I would like to do is run the script on docs PRs, since a name being documented while also being in ignored_c_api.txt will cause it to fail. So, if someone merges new documentation without updating ignored_c_api.txt, we'll see blocking failures on all C code PRs until we fix it. I haven't looked too closely at the GHA for change detection, but if you see an easy way to do that, would you mind doing it in this PR?

See #143573.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou merged commit 234a15d into python:main Jan 9, 2026
65 checks passed

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 9, 2026
@miss-islington-app

miss-islington-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

Sorry, @encukou, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 234a15dc4ec2d8f8ababea91532ebe896a96387a 3.14
All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou deleted the doccheck-glob-findall branch January 9, 2026 10:16
@miss-islington-app miss-islington-app Bot assigned encukou Jan 9, 2026
@miss-islington-app

miss-islington-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

Sorry, @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 234a15dc4ec2d8f8ababea91532ebe896a96387a 3.13
All reactions

Sorry, something went wrong.

Uh oh!

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

encukou added a commit to encukou/cpython that referenced this pull request Jan 9, 2026
@encukou
[3.14] pythongh-141004: Improve make check-c-api-docs (pythonGH-143564
4dc8864
)

- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15d)
@bedevere-app

bedevere-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

GH-143593 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jan 9, 2026
encukou added a commit to encukou/cpython that referenced this pull request Jan 9, 2026
@encukou
pythongh-141004: Improve make check-c-api-docs (pythonGH-143564)
5663858
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15d)
@bedevere-app

bedevere-app Bot commented Jan 9, 2026

Copy link
Copy Markdown

GH-143594 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jan 9, 2026
encukou added a commit that referenced this pull request Jan 12, 2026
@encukou
[3.14] gh-141004: Improve make check-c-api-docs (GH-143564) (GH-143593
deb75a5
)

- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15d)
encukou added a commit that referenced this pull request Jan 12, 2026
@encukou
[3.13] gh-141004: Improve make check-c-api-docs (GH-143564) (GH-143594
b06ef5b
)

- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)

(cherry picked from commit 234a15d)
@bedevere-bot

bedevere-bot commented Jan 12, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 MacOS Intel NoGIL 3.13 (tier-2) has failed when building commit b06ef5b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1449/builds/1695) and take a look at the build logs.
  4. Check if the failure is related to this commit (b06ef5b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1449/builds/1695

Failed tests:

  • test.test_multiprocessing_forkserver.test_processes

Failed subtests:

  • test_repr_rlock - test.test_multiprocessing_forkserver.test_processes.WithProcessesTestLock.test_repr_rlock

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.itamaro-macos-intel-aws.nogil/build/Lib/test/_test_multiprocessing.py", line 1493, in test_repr_rlock
    self.assertEqual('<RLock(SomeOtherThread, nonzero)>', repr(lock))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '<RLock(SomeOtherThread, nonzero)>' != '<RLock(None, 0)>'
- <RLock(SomeOtherThread, nonzero)>
+ <RLock(None, 0)>
All reactions

Sorry, something went wrong.

Uh oh!

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

reidenong pushed a commit to reidenong/cpython that referenced this pull request Jan 12, 2026
@encukou @reidenong
pythongh-141004: Improve make check-c-api-docs (pythonGH-143564)
279c0d1
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@encukou @thunder-coding
pythongh-141004: Improve make check-c-api-docs (pythonGH-143564)
21755bf
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes

Uh oh!

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

Assignees

@encukou encukou

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.

4 participants

@encukou @StanFromIreland @bedevere-bot @ZeroIntensity
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 01402520 — 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.