Begin the Python 3.15 target and essential-library migration - #8950
youknowdot wants to merge 8 commits into
Conversation
Add unique sentinel values with copy/pickle identity, caller module capture, union support, and cycle collection. Compare constructor behavior and six upstream tests with CPython v3.15.0rc2; retain the existing Python target and bundled libraries. Assisted-by: Codex:model-version-unavailable
Expose _imp._set_lazy_attributes(modobj, name, /), used by CPython 3.15 importlib after eager loading. Match its empty pending-lazy-module registry behavior, including name type and string-subclass hashing checks. This does not implement lazy imports or change the target version or bundled libraries. Assisted-by: Codex:model-version-unavailable
Add Python 3.15 compile(module=...) warning filtering. Move format-spec diagnostics to a fallible, literal-aware AST boundary; preserve nested literal warnings while excluding raw text and comments, map function-type fragments to source locations, and suppress duplicate type-comment emissions with per-call tracking. Keep unrelated legacy warning-detection and exact diagnostic metadata gaps documented by differential probes. Add focused flag, source-location, exception, reentrancy, filtering and literal-boundary regression coverage. Assisted-by: Codex:model-version-unavailable
Add a private exact-dict move primitive and importlib dispatcher so shutdown-order updates never temporarily remove a module. Preserve current values and custom-mapping fallback behavior; validate reentrant equality probe witnesses, invalidate layout caches, and compact moved entries. Cover all four existing bootstrap reorder sites, including legacy-loader cleanup. Add deterministic trace-window, loader replacement/removal, reentrancy, cache, iterator and compaction regressions. The private native primitive uses true-move semantics; it does not promise arbitrary pop/set callback equivalence. Assisted-by: Codex:model-version-unavailable
Target Python 3.15.0alpha and import site, pkgutil, importlib and supporting test libraries from CPython v3.15.0rc2 (435c9e5a798c99653e3ab64ce29baed0e4f3dfee). Keep native atomic module-cache movement at the surviving importlib reorder sites and use the canonical builtin import callback. Preserve explicit temporary eager-import and readonly-table adaptations while their full PEP implementations remain separate. This starts the migration and does not claim complete 3.15 bytecode or runtime compatibility. Assisted-by: Codex:model-version-unavailable
Import pinned rc2 test_import and its fixtures, preserving RustPython markers. The upstream tests remove obsolete module.__cached__ expectations. Match create_builtin validation for missing, non-string, empty, non-ASCII and unknown module names; unknown names must not succeed just because an unrelated module is cached. Add a CPython differential regression. Assisted-by: Codex:model-version-unavailable
Use the PyStr reference directly after validating the ASCII name, fixing the compile error from the previous PyUtf8Str-only accessor. Assisted-by: Codex:model-version-unavailable
Make the remaining compatibility work explicit in the project overview rather than implying that the initial target change completes support. Assisted-by: 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. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (1 tests)
[ ] lib: cpython/Lib/pkgutil.py dependencies:
dependent tests: (11 tests)
[ ] test: cpython/Lib/test/test_import (TODO: 3) dependencies: dependent tests: (no tests depend on import) [ ] lib: cpython/Lib/test/support dependencies:
dependent tests: (2 tests)
[ ] lib: cpython/Lib/importlib dependencies:
dependent tests: (130 tests)
Legend:
|
Summary
Begin the Python 3.15 migration by changing the interpreter target to 3.15.0alpha and bringing up the essential libraries against CPython v3.15.0rc2 (
435c9e5a798c99653e3ab64ce29baed0e4f3dfee). The interpreter boots with normal site initialization and with-S, using the new frozen importlib and the matching source library tree.This draft includes the pending native prerequisites from #8945 (sentinel), #8946 (eager
_imphook), #8947 (compile(module=...)) and #8948 (atomic module-cache reordering). The target/library commits follow those prerequisites; no broader standard-library or complete compiler port is included._sitebuiltins, pkgutil, importlib (including metadata/resources), test.support, test_importlib, test_import and their required fixtures from the pinned sourcescripts/update_lib; remove obsolete upstream test locations and retain support helpers still used by unmigrated 3.14 tests_imp.create_builtinname validation and missing-builtin error behavior, with native/CPython differential regression coverageRemaining compatibility work
._pthno-user-site case retains one precise expectedFailure for existing unsupported._pthconfiguration. No blanket new skip or assertion changes were addedThe generated
upgrade-pylibautomation source and lock are unchanged. Their pre-existing pin/compiler drift needs a separate generator update. Only the standalone documentation-update workflow's comparison default changes here.Validation
Actual release startup, target/cache tag, frozen atomic/hierarchical importlib, all native prerequisite APIs and source-Lib paths were verified. The six native regression snippets pass, including the new builtin-loader validation; their CPython 3.15 comparisons pass as well.
test_site test_support test_importlib test_pkgutil test_import test_compile test_ast test_warnings test_dict test_ordered_dict: 2,545 tests run, 195 skipped, all ten suites successful__import__andimport_moduleThe earlier unmigrated test_import run failed five times because upstream 3.15 no longer sets module
__cached__. Migrating the matching tests/fixture resolved those errors. Its new warning-filtering test passes; the new builtin-loader validation requirement is implemented directly rather than marked as an expected failure.At publication, GitHub CI and performance workflows require maintainer approval. The existing dependency job succeeds but reads the base branch's 3.14.7 pin after checking out only PR Lib files; its green status does not validate the new 3.15 dependency graph. The local essential suites above use the pinned 3.15.0rc2 libraries.
AI assistance
Implemented, reviewed and tested with OpenAI Codex under the requesting RustPython maintainer's direction. No human code review or maintainer privilege is implied for this account. The runtime does not expose an exact model version; commits use
Assisted-by: Codex:model-version-unavailablerather than inventing one.