Repository navigation
Restore ten guarded C API test modules with explicit updater import bindings - #9505
Draft
youknowdot wants to merge 1 commit into
Draft
youknowdot wants to merge 1 commit into
youknowdot wants to merge 1 commit into
Conversation
Restore ten CPython 3.15 test modules through the actual update_lib migrator. Eight are canonical copies; codecs/getargs use declared exact optional-module and required-attribute bindings while all class/function/decorator/assertion ASTs remain unchanged. Extend the landed generic updater with an explicit import-binding rewrite option, preserving default validation and hash/path/block/protected-AST guards. Reproduced on main 88f3733 after both prerequisite PRs landed. The recovered reviewed tooling delta is applied before migration; no synthetic dependency commit is included. Current host tooling suite passes 241 tests with Python 3.13, selected AST/source proof and normal hooks pass, and all output bytes match preserved historical Python 3.15 migration hashes. This is not a fresh Python 3.15 runtime or dependency-graph validation. No C API test modules or native fixtures were executed; unsupported fixture skips are not complete C API compatibility. Assisted-by: OpenAI Codex:model version unavailable
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Contributor
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_capi (TODO: 2) dependencies: dependent tests: (no tests depend on capi) Legend:
|
Member
|
do not add this before #9270 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Restore ten whole
test_capimodules from pinned CPython 3.15 (d220409a13b77de7a6c30abe16ea90db01528edc) through the actualscripts/update_lib migratecommand:test_file,test_object,test_run,test_set,test_slots,test_tuple,test_complex,test_float.test_codecs: use the existing optional import helper for_testcapibefore the unchanged_testlimitedcapigate.test_getargs: bind the genuinely requiredgetargs_keywordsandgetargs_keyword_onlythrough existingsupport.get_attribute. A partial fixture such as Add a _testcapi module #9143 lacks these APIs; this raises a real capability skip rather than an import failure. The unchanged complex/float sibling imports propagate that skip.All class/function bodies, decorators and assertions remain canonical. No new skip decorators, xfails, fake fixtures or global test-disable switches are introduced. This is source restoration, not implementation of these C API fixtures. The package still has 22 missing canonical files afterward.
Generic updater extension
Add explicitly declared
import_binding_rewritesto the already landed new-file adaptation mechanism. Only exact, same-name import-to-canonical-helper bindings are admitted, with module/name/alias/order/provenance and scope-shadow checks. Validated groups retain their position among protected statements. Existing default migrations, source-hash/path/block/overlap/overwrite protections and class/function AST checks remain unchanged. Relative/dotted/star imports and unsupported rewrite forms fail closed.#9498 and #9501 have landed. This diff contains only the new tooling extension and ten module additions; no duplicated parent code or synthetic dependency commit.
Validation
88f373357f40923c7b1bb533072e7962790e2663; all 17 original parent-file bytes were checked against their PR heads.Limits and future activation
No C API test module was imported or executed locally, and no Rust/native build or full interpreter suite was run for this source-only cohort. Missing-fixture skips in ordinary builds are not C API behavioral passes or complete CPython compatibility.
If a future
_testcapiprovides both getargs entry points, re-review the subsequent constants, eager class-bodygetargs_positional_only_and_keywordsimport and remaining parser APIs before activation. Introducing_testlimitedcapisimilarly requires separate review of NULL/invalid arguments, refcounts, mutation, GC/finalizer and subprocess paths. Existing bodies are preserved, not claimed safe or supported by module presence alone.AI assistance
OpenAI Codex assisted source investigation, updater implementation, migration, recovery and validation, with independent agent review. The runtime model version is unavailable. This reports tool/source evidence, not human manual validation or unexecuted native compatibility checks.