Repository navigation
Restore ten guarded C API test modules - #9505
youknowdot wants to merge 2 commits 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
|
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. |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/codecs.py dependencies:
dependent tests: (202 tests)
[ ] test: cpython/Lib/test/test_faulthandler.py (TODO: 4) dependencies: dependent tests: (5 tests)
[ ] test: cpython/Lib/test/test_capi (TODO: 2) dependencies: dependent tests: (no tests depend on capi) [x] lib: cpython/Lib/sqlite3 dependencies:
dependent tests: (2 tests)
[ ] test: cpython/Lib/test/test_free_threading (TODO: 1) dependencies: dependent tests: (no tests depend on free_threading) Legend:
|
|
do not add this before #9270 |
bcbcc06 to
2b751f7
Compare
Keep all ten C API test files unchanged. Existing whole-file migration with exact preservation blocks reproduces both adapted modules without a separate import-binding rewrite system. The C API dependency hold remains unchanged. Assisted-by: OpenAI Codex:model version not exposed
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.
Tooling consolidation
The import-binding rewrite extension has been removed. This PR now contains only the ten whole test files, unchanged from their prior reviewed bytes. The existing
migrate --patchespreservation blocks reproduce both adapted files exactly without another import-rewrite framework. Updater implementation changes are consolidated in #9578.The existing hold remains: do not add these tests before #9270 lands.
Current consolidation validation
Lib/files are byte-identical to the prior PR head.Original validation (before tooling removal)
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.