Skip to content

Align sys runtime metadata with Python 3.15 - #9194

Draft
youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/sys-runtime-metadata-315
Draft

youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/sys-runtime-metadata-315

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Expose Python 3.15 sys.abi_info using RustPython's native pointer width, byte order, and existing free-threaded/non-Py_DEBUG build metadata.
  • Align the 18-element sys.flags tuple with canonical field ordering, expose gil=0, and return integer context flags without adding tuple slots.
  • Report sys.thread_info.lock=None for RustPython's parking_lot implementation rather than an obsolete CPython lock name.
  • Refresh the complete canonical test_sys from CPython d220409a13b77de7a6c30abe16ea90db01528edc, preserving all existing RustPython guards.

This is an independent Python 3.15 mega split. _is_python_build and monitoring CAPI exports remain outside its scope.

Validation

Final source: 968261417df5c5bee1518ccb937216f09606bf4f.

  • Fresh release filesystem build and private-library startup provenance check passed.
  • The same five canonical metadata/flags methods passed on RustPython and pinned CPython 3.15: 5/5 on each.
  • cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi: 1,400 passed, 18 ignored.
  • cargo test from crates/capi, default test profile: 123 passed, 4 ignored.
  • Strict workspace and CAPI Clippy (--all-targets -- -D warnings), using separate default profiles: passed.
  • Normal commit hooks passed. All existing RustPython test guards preserved.

Native tests generated bytecode caches; these were quarantined intact and clean source/dependency/oracle audits repeated. No tracked files changed during validation.

The local canonical comparison deliberately selects the five metadata/flags tests and excludes TestRemoteExec; no remote-process inspection was exercised.

Implementation, canonical test refresh, validation, and this PR description were prepared with OpenAI Codex.

Assisted-by: OpenAI Codex:model version unavailable

Expose ABI metadata, preserve the canonical sys.flags tuple order and named flags, and report the native lock implementation honestly. Refresh canonical test_sys while preserving RustPython guards.

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

coderabbitai Bot commented Oct 18, 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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

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

:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
[x] test: cpython/Lib/test/test_sys.py (TODO: 4)
[x] test: cpython/Lib/test/test_syslog.py
[x] test: cpython/Lib/test/test_sys_setprofile.py (TODO: 1)
[ ] test: cpython/Lib/test/test_sys_settrace.py
[x] test: cpython/Lib/test/test_audit.py (TODO: 16)
[x] test: cpython/Lib/test/audit-tests.py

dependencies:

dependent tests: (236 tests)

  • sys: regrtestdata test___all__ test__colorize test__locale test__osx_support test_android test_annotationlib test_argparse test_array test_asdl_parser test_ast test_asyncio test_audit test_base64 test_bdb test_bigaddrspace test_bigmem test_binascii test_bisect test_buffer test_builtin test_bytes test_bz2 test_c_locale_coercion test_calendar test_class test_clinic test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_code_module test_codeccallbacks test_codecs test_collections test_compile test_compileall test_complex test_concurrent_futures test_context test_contextlib test_coroutines test_cprofile test_csv test_ctypes test_datetime test_dbm test_dbm_sqlite3 test_decimal test_descr test_dict test_difflib test_dis test_doctest test_doctest2 test_docxmlrpc test_dtrace test_dynamic test_dynamicclassattribute test_email test_embed test_ensurepip test_enum test_enumerate test_eof test_except_star test_exceptions test_external_inspection test_faulthandler test_fcntl test_file_eintr test_fileinput test_float test_fork1 test_format test_fractions test_frame test_frozen test_functools test_future_stmt test_gc test_generated_cases test_generators test_genericpath test_genexps test_getopt test_glob test_grammar test_gzip test_hash test_hashlib test_http_cookiejar test_httpservers test_importlib test_inspect test_int test_io test_ioctl test_iter test_itertools test_json test_launcher test_list test_listcomps test_locale test_logging test_long test_lzma test_mailbox test_marshal test_math test_memoryview test_metaclass test_mimetypes test_mmap test_monitoring test_msvcrt test_multibytecodec test_multiprocessing_main_handling test_netrc test_ntpath test_numeric_tower test_operator test_optparse test_ordered_dict test_os test_osx_env test_pathlib test_patma test_pdb test_peepholer test_perfmaps test_pickle test_pkg test_pkgutil test_platform test_plistlib test_popen test_posixpath test_print test_profile test_property test_pty test_pwd test_py_compile test_pyclbr test_pydoc test_pyexpat test_pyrepl test_quopri test_raise test_range test_re test_regrtest test_repl test_reprlib test_resource test_runpy test_sax test_scope test_script_helper test_select test_selectors test_shutil test_signal test_site test_slice test_smtplib test_socket test_sqlite3 test_ssl test_stable_abi_ctypes test_stat test_statistics test_str test_strftime test_string_literals test_strptime test_strtod test_struct test_subprocess test_support test_sys test_sys_setprofile test_sys_settrace test_sysconfig test_syslog test_tabnanny test_tarfile test_tempfile test_termios test_threading test_threading_local test_threadsignals test_time test_timeit test_tomllib test_tools test_trace test_traceback test_tracemalloc test_tuple test_type_cache test_type_comments test_types test_typing test_unicode_file test_unicode_file_functions test_unicodedata test_unittest test_urllib test_urllib2 test_urllib2net test_urlparse test_utf8_mode test_uuid test_venv test_wait3 test_wait4 test_wave test_weakref test_webbrowser test_winconsoleio test_winreg test_with test_wsgiref test_xml_etree test_xmlrpc test_xpickle test_zipapp test_zipfile test_zipfile64 test_zipimport test_zipimport_support test_zlib

Legend:

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

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.

1 participant