Skip to content

Restore canonical limited C API consumer tests - #9501

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:sync-limited-capi-canonical-20261031
Oct 31, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:sync-limited-capi-canonical-20261031

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Restore ten missing limited-C-API fixture consumer test modules from pinned CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc) using the existing scripts/update_lib migrate command, with the canonical test_capi package entry points.

All twelve files are byte-identical to the pin. No native implementation, fixture registration, global test-enablement flag, adapter, skip, or assertion is changed. Each test module already has CPython's early optional _testlimitedcapi import gate, before fixture attribute accesses and test definitions. The canonical missing-fixture gate is preserved rather than introducing RustPython-specific skips.

This is source restoration, not C API support or passing test-body coverage. Current RustPython has no _testlimitedcapi fixture module. Future partial fixture implementations must be checked against these original assertions before activating their bodies. The package still lacks 32 of its 44 canonical Python files; actual update_lib todo continues to report test_capi pending.

Validation

  • Actual update_lib migrate for all 12 files.
  • Exact byte SHA256 and full AST comparison with the pin; syntax compile only, without executing test code.
  • Early-guard ordering source verification and no sibling-test dependency.
  • Normal configured prek checks passed; source hashes unchanged afterward.
  • No local interpreter tests or native builds performed (source-only gate).

Scope

No direct changed-file overlap with #9143 or #9270; this does not implement their native fixtures, CI capability or Windows exports. This is a bounded source-restoration slice of the Python 3.15 upgrade tracked in #8954. No dependency on #9498 updater adaptations.

AI disclosure

OpenAI Codex assisted with source selection, safety/ownership review, the updater invocation, source-identity and tooling checks, and this description. The restored Python files themselves are unchanged upstream CPython source. No human runtime verification or successful C API body execution is claimed; this draft is explicitly limited to canonical source restoration.

Restore ten missing test modules and two package entry points with scripts/update_lib migrate from CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve canonical optional-fixture import guards without changing assertions or enabling native fixtures. This is source restoration, not C API support; 32 package files remain missing.

OpenAI Codex assisted source selection, source-only safety review, migration, and byte/AST/tooling validation. No local interpreter tests or native builds were run.

Assisted-by: OpenAI Codex:model version unavailable
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] test: cpython/Lib/test/test_capi

dependencies:

dependent tests: (no tests depend on capi)

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@codspeed

codspeed Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:sync-limited-capi-canonical-20261031 (7d22d95) with main (713e14c)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@youknowone
youknowone marked this pull request as ready for review October 31, 2026 23:19
@youknowone
youknowone merged commit 88f3733 into RustPython:main Oct 31, 2026
22 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-31T23:19:55.839682Z 7d22d95 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d22d9558b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,12 @@
import os

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required machine-readable AI-assistance trailer

The reviewed commit explicitly documents OpenAI Codex assistance, but its message contains no Assisted-by: AGENT_NAME:MODEL_VERSION trailer. The prose ## AI disclosure section does not satisfy the per-tool, tool-and-model attribution format required by AGENTS.md. Include the required trailer for the AI tool used so this contribution complies with the repository’s attribution convention.

AGENTS.md reference: AGENTS.md:L23-L23

Useful? React with 👍 / 👎.



def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Perform the required RustPython validation for the package

For this Lib/ restoration, the commit explicitly reports that no interpreter tests or native builds were performed. Byte comparisons and AST checks do not exercise this new package-discovery entry point or establish that RustPython reaches the optional-fixture skips successfully. AGENTS.md requires workspace tests, C-API tests from crates/capi, and the relevant interpreter test module; run those checks or record a concrete environmental blocker rather than treating source restoration as an exemption. The review attempts stopped at dependency resolution because the pinned parking_lot_core dependency is unavailable offline, so runtime validation remains unverified.

AGENTS.md reference: AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants