16738 Commits

Author SHA1 Message Date
Shahar Naveh
8e35cc9e72 Update asyncio to 3.14.5 (#8012) 2026-06-02 09:48:45 +00:00
Bas Schoenmaeckers
5b2f6bc270 Add sequence protocol to the c-api (#8016) 2026-06-02 09:33:26 +00:00
Shahar Naveh
b5b82587dd Update test_super.py to 3.14.5 (#8015) 2026-06-02 09:25:40 +00:00
dependabot[bot]
ef74577f4b Bump codecov/codecov-action from 6.0.0 to 6.0.1 (#7979)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](57e3a136b7...e79a6962e0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-02 18:12:00 +09:00
Shahar Naveh
14cb5dd874 Remove node24 installation. It's the default now (#8014)
* Remove node24 installation. It's the default now

* Fix insta tests for llvm-cov
2026-06-02 18:07:32 +09:00
Shahar Naveh
a781980d9b Update importlib to 3.14.5 (#8013) 2026-06-02 18:06:36 +09:00
Shahar Naveh
6a860b635a Update some tests to 3.14.5 (#7991) 2026-06-02 18:00:54 +09:00
Shahar Naveh
0c9ed36b79 CI: Don't skip windows tests (#8004) 2026-06-02 15:42:33 +09:00
Bas Schoenmaeckers
2c46b69e4b Add weakref support to c-api (#8006) 2026-06-02 15:31:21 +09:00
Bas Schoenmaeckers
74b4707b65 Add mapping c-api functions (#8003) 2026-06-02 15:20:45 +09:00
Bas Schoenmaeckers
885cf5c29c Add set object functions to c-api (#8002) 2026-06-02 00:35:43 +09:00
Shahar Naveh
3e1c3bc86d impl _queue module + Update multiprocessing to 3.14.5 (#7994) 2026-06-02 00:35:17 +09:00
Bas Schoenmaeckers
36a1722d1b Add agent skill for adding c-api functions (#8001)
* Add agent skill

* abi3/abi3t only
2026-06-02 00:34:06 +09:00
Shahar Naveh
1ce37bf2d4 Update test_file_eintr.py to 3.14.5 (#7999) 2026-06-01 00:08:40 +09:00
James Clarke
0e66439212 Tests: update test_codecmaps_{cn,hk,jp,kr,tw}, test_pstats, test_profile, test_cprofile, test_tracemalloc, test_multibytecodec from v3.14.5 (#7978)
* Update pstats from v3.14.5

* Update profile from v3.14.5

* Update tracemalloc from v3.14.5

* Update test_multibytecodec from v3.14.5

* Mark failing tests in test_pstats

* Mark failing test in test_profile

* Mark failing tests in test_cprofile

* Mark failing tests in test_tracemalloc

* Mark failing tests in test_multibytecodec

* Added comment marker to test_pstats.py

---------

Co-authored-by: CPython Developers <>
2026-05-31 21:47:03 +09:00
Shahar Naveh
8018ba689f Add errno.EHWPOISON (#7996) 2026-05-31 21:31:21 +09:00
Shahar Naveh
26f817a55b Fix broken CI (rustc 1.96) (#7992)
* Fix lints for clippy 1.96

* Try to fix example

* Put fix in correct place
2026-05-30 20:16:49 +09:00
Shahar Naveh
938d42184f Update some tests to 3.14.5 (#7990)
* Update `test_embed.py` to 3.14.5

* Update `test_cmd_line*` to 3.14.5

* Update unicode related tests

* Update `test_script_helper.py`

* Update `test_gc.py`
2026-05-30 20:16:10 +09:00
Jeong, YunWon
1385c4e472 rename ssl-vendor (#7989) 2026-05-28 09:37:44 +03:00
Shahar Naveh
fc637a155d [META] AI policy (#7914)
* Add `CONTRIBUTING.md` and link it in the readme

* Add TBD PR template

* Merge `DEVELOPMENT.md` -> `CONTRIBUTING.md`

* Revise `PULL_REQUEST_TEMPLATE.md`

* Have checkboxes
2026-05-28 12:43:43 +09:00
Joshua Megnauth
7d54ba502e Fix ssl-vendor (OpenSSL) (#7985)
Closes: #7893

Fix 1:
`foreign-types-shared` needs to match `openssl`'s version. Bumping it is
a SemVer violation because the latest versions of the crate aren't
backwards compatible with older versions.
See: rust-openssl/rust-openssl#2461

Fix 2:
The second fix is to align the `openssl` module with the latest
`host_env` and `ssl` changes.
2026-05-28 12:16:08 +09:00
Shahar Naveh
e80a14ba12 Align more error messages with CPython 3.14.5 (#7988)
* Cannot assign to True/False/None

* cannot use assignment expressions with ...

* cannot assign to function call/expression
2026-05-28 11:19:03 +09:00
Joshua Megnauth
30ae48b24b Support custom rustls providers (#7657)
* Modularize rustls as work towards providers

`rustls`'s architecture is very clean and trait-driven. There are many
providers for `rustls` including the built-in `aws-lc-rs` and `ring` as
well as backends for `boringssl`, `graviola`, `openssl`, `mbedtls`, etc.

This commit removes the hard dependency on `aws-lc-rs` and adds support
for `ring`. It works towards #7059 as well.

* Clean up rustls features

* Remove ring as an explicit feature
* ssl-rustls is the default and implies aws-lc

* Support custom rustls crypto providers

The new feature, `ssl-rustls-no-provider`, enables custom rustls
providers. By default, `aws-lc-rs` is enabled which matches the old
behavior and keeps backward compatibility.

I wrote a new type that abstracts what we need from crypto providers.
CryptoExt encapsulates the ticketer as well as cipher suites and KX
groups. I wrote fallbacks to help select a reasonable default if a
provider is missing features (they all seem to support the same things
though).

I also wrote an example to show how to actually use custom providers.

* Fix duplicate VERIFY_X509 constants and unused imports in ssl module

Remove duplicate VERIFY_X509_STRICT/VERIFY_X509_PARTIAL_CHAIN definitions
from compat.rs (already defined in _ssl module with #[pyattr]).
Remove unused imports: ClientConnection, ServerConnection.

* no-provider as default

* Fix CI failures: openssl build, wasm target, cargo-shear

- Update openssl.rs to use renamed sock_wait/SockWaitKind and add vm parameter
- Add skip_ssl for wasm32-wasip2 target (aws-lc-sys cannot build for wasm)
- Remove unused workspace dependency aws-lc-rs
- Fix foreign-types-shared version to match openssl's dependency (0.1)
- Restore Cargo.lock from upstream/main

---------

Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
2026-05-28 11:07:09 +09:00
Jeong, YunWon
1a959cf7f3 Align codegen passes and opcode metadata with CPython (#7987)
* Share marshal ref table between code object and its internals

read_marshal_bytes, _str, _str_vec, _name_tuple, and _const_tuple now
take a shared ref table and resolve TYPE_REF / register FLAG_REF
entries. deserialize_code is split into a public wrapper and an inner
function that receives the ref table; deserialize_value_depth opens a
fresh inner ref space when it hits Type::Code, mirroring CPython's
behaviour of putting the code object itself at ref slot 0. Nested code
objects inside const tuples reuse the surrounding code's ref space via
the new read_const_value helper.

* Align PYC magic number, FORMAT_VERSION, and header check with CPython 3.14

PYC_MAGIC_NUMBER changes from 2994 to 3627, matching CPython 3.14's
pyc_magic_number_token (0x0a0d0e2b). marshal FORMAT_VERSION drops from
5 to 4 (the encoder/marshal.version value; the decoder already accepts
both). check_pyc_magic_number_bytes now compares all four magic bytes
instead of the first two.

* Accept CPython-tagged .pyc as read-only bytecode source

SourceFileLoader.get_code now also looks for .pyc files using
_RP_FALLBACK_CACHE_TAGS (currently ('cpython-314',)) in addition to
sys.implementation.cache_tag. The matched .pyc is only used for
reading; recompilation still writes to the RustPython-tagged path, so
CPython's .pyc is never overwritten. Source-stat / hash / timestamp
validation logic is unchanged.

* Apply rustfmt to marshal helpers

* Marshal PySlice from format version 4 instead of 5

CPython's marshal supports TYPE_SLICE from format version 4 onwards
and that is the default version. Rejecting slice dumps below version
5 made marshal.dumps(slice(...)) fail with the default version and
broke test.test_marshal.SliceTestCase.test_slice.

* Revert "Accept CPython-tagged .pyc as read-only bytecode source"

Lib/importlib/_bootstrap_external.py is CPython's own code copied
verbatim; local patches here defeat compatibility tracking. The
cpython-XX cache_tag fallback needs to live on the RustPython side
(Rust code or sys.implementation.cache_tag policy), not as edits to
the imported standard library.

This reverts commit 1fc426d0fb5fcdb50d35cad13bbb43e8f6ce1c7f.

* Set marshal FORMAT_VERSION to 5 to match CPython 3.14.5

Py_MARSHAL_VERSION is 5 in CPython 3.14.5 (Include/marshal.h:16) and
TYPE_SLICE serialization rejects version < 5 (Python/marshal.c:720).
Restore the same threshold and constant so marshal.version and the
slice-marshal gate match CPython.

* Thread marshal recursion depth through nested code objects

Code objects embedded in const-tuples reset the depth budget on each
recursion, so a hostile or pathological marshal stream of code-in-tuple-
in-code can blow the stack despite MAX_MARSHAL_STACK_DEPTH. Pass the
current depth through deserialize_code_inner and read_marshal_const_tuple
and decrement at each code-object/tuple boundary.

Also route dict keys through deserialize_value_after_header so TYPE_CODE
keys decode instead of failing with BadType.

* align compiler to CPython

* Align codegen with CPython compile.c

Rename CFG helpers and accessors to the names used in CPython's
compile.c (basicblock_next_instr, basicblock_last_instr,
basicblock_append_instructions, bb_has_fallthrough, is_jump,
make_cfg_traversal_stack, mark_warm/mark_cold, etc.). Drop the unused
boolop-folding gate, mark_cpython_cfg_label_block helper, and
ComprehensionLoopControl::iter_range field.

Track an is_coroutine flag on SymbolTable, set in async def, await, and
async comprehensions, and propagate it through non-generator
comprehensions per symtable_handle_comprehension().

Mark SetupCleanup/SetupFinally/SetupWith as has_arg pseudo-ops, mark
ForIter as a terminator, and add has_arg/has_const on AnyInstruction.
Fix Instruction::stack_effect_jump to delegate to the opcode's
stack_effect_jump rather than stack_effect.

* Align codegen IR with CPython CFG structures

* Match CPython CFG annotation offset arithmetic

* Propagate CPython CFG label translation errors

* Align CPython exception target labeling flow

* Propagate CPython CFG traversal stack allocation errors

* Match CPython optimize_load_fast allocation flow

* Propagate CPython basicblock allocation errors

* Propagate CPython redundant NOP cleanup errors

* Propagate CPython unused const cleanup errors

* Propagate CPython const folding errors

* Propagate CPython swaptimize allocation errors

* Match CPython list-to-tuple fold allocation

* Skip const folding on CPython allocation failures

* Skip subscript folding on CPython allocation failures

* Propagate CPython assembler allocation errors

* Propagate CPython localsplus allocation errors

* Propagate CPython localsplus setup allocation errors

* Propagate CPython jump label map allocation errors

* Propagate CPython instruction sequence allocation errors

* Propagate CPython instruction label allocation errors

* Guard CPython codegen block allocation

* Guard CPython label shadow allocation

* Propagate CPython label shadow allocation errors

* Align CPython c-array allocation updates

* Align CPython ref stack growth

* Match CPython CFG builder debug check

* Avoid Rust-only CFG append clone

* Reuse CPython cleared block slots

* Use CPython block append in copy_basicblock

* Match CPython cfg builder creation order

* Clear label map after CPython apply pass

* Match CPython cfg builder allocation check

* Propagate CPython c-array size errors

* Drop Rust-only label uniqueness check

* Drop Rust-only label shadow debug checks

* Propagate CFG block index overflow

* Propagate CFG label oparg overflow

* Model CPython basicblock instruction storage

* Drop Rust-only recorded CFG precheck

* Model CPython instruction sequence storage

* Propagate instruction sequence offset overflow

* Model CPython instruction sequence labels

* Match CPython jump offset arithmetic

* Match CPython exception table arithmetic

* Match CPython label index arithmetic

* Match CPython instruction offset casts

* Match CPython jump offset indexing

* Match CPython oparg locals casts

* Match CPython localsplus offset arithmetic

* Match CPython cell prefix indexing

* Match CPython C array growth arithmetic

* Match CPython label map allocation arithmetic

* Match CPython label map size tracking

* Use CPython label map size in sequence passes

* Assert CPython label map clearing invariants

* Match CPython label oparg assignment

* Match CPython compiler direct arithmetic

* Match CPython load fast local casts

* Match CPython load fast depth assert

* Match CPython resume depth flagging

* Match CPython stack depth arithmetic

* Drop Rust-only stack overflow error

* Return CPython stack depth directly

* Match CPython C array growth errors

* Match CPython instruction insert asserts

* Match CPython unreachable pseudo jump

* Match CPython CFG size guard

* Match CPython superinstruction assert

* Match CPython redundant jump assert

* Match CPython stackdepth errors

* Match CPython jump offset flow

* Match CPython assembler buffer defaults

* Match CPython bytecode emit growth

* Match CPython assembler entry growth

* Match CPython assembler growth overflow check

* Match CPython remove_unreachable structure

* Match CPython static swap flow

* Inline CPython code unit preprocessing

* Match CPython C array growth checks

* Match CPython label map size guard

* Match CPython load-fast flow

* Simplify CPython CFG condition flow

* Align exception fallthrough propagation

* Match CPython pseudo target table

* Match CPython annotations CFG assert

* Match CPython inverted op assert

* Match CPython many-locals guard

* Reject deopt opcodes in CFG stack effects

* Match CPython invalid stack effect error

* Test CPython deopt stack effect guard

* Match CPython load-fast extended-arg assert

* Match CPython instruction allocation asserts

* Match CPython basicblock last-instr asserts

* Match CPython opcode range asserts

* Assert CPython fallthrough line propagation invariant

* Assert CPython CFG target offset sign

* Assert CPython exception fallthrough invariant

* Assert CPython exception stack bounds

* Assert CPython traversal stack allocation

* Match CPython label-map allocation in shadow

* Mirror CPython label-map sentinel fill

* Match CPython CFG builder allocation asserts

* Match CPython exception stack structure

* Match CPython ref stack structure

* Match CPython CFG traversal stack structure

* Mirror CPython CFG traversal stack pointer

* Use CPython fixed exception handler stack

* Mirror CPython ref stack capacity field

* Match CPython swap optimizer scratch stack

* Align static swap helpers with CPython blocks

* Align swaptimize signature with CPython

* Match CPython redundant pair pass result

* Match CPython inline pass result

* Match CPython redundant NOP pass results

* Fix bytecode metadata after upstream rebase

* Match CPython opcode stack metadata

* Add CPython identifiers to cspell dictionary

Add CNOTAB, LNOTAB, ialloc, ioffset, iused, nblocks, ncellsused,
ncellvars, nextop, noffsets, nvars, swaptimize, untargeted to
.cspell.dict/cpython.txt for the new CFG/assembler code in
crates/codegen/src/ir.rs.

* Fix CI failures from bytecode-parity work

- clippy: drop redundant `test_` prefix on three test functions and
  remove an unnecessary `u32` cast in basicblock_clear_reuses_cpython_spare_slots_in_offset_order
- insta: regenerate nested_double_async_with snapshot to match the new
  CFG output that drops unreferenced labels after the redundant-NOP pass
- regrtest: drop `@expectedFailure` markers from test_func_args,
  test_meth_args (test_compile), test_disassemble_with,
  test_disassemble_try_finally (test_dis), and test_except_star
  (test_monitoring) which now pass

* Resync generated opcode metadata

Empty conf.toml since WithExceptStart and Setup{Cleanup,Finally,With}
stack effects already match CPython, so the TODO override entries are
stale and only cause CI hook diffs.

Regenerate opcode_metadata.rs and drop the matching SetupCleanup/
SetupFinally/SetupWith assertions on PseudoOpcode::has_arg(); their
`HAS_ARG` flag comes from pseudo definitions in bytecodes.c that the
upstream analyzer does not propagate through PseudoInstruction.properties,
so the generated has_arg() excludes them. has_target() still covers
these block-push pseudos via is_block_push().

* Drop is_block_push has_arg invariant

The CPython invariant `assert(OPCODE_HAS_ARG(op) || !IS_BLOCK_PUSH(op))`
relies on SETUP_{FINALLY,CLEANUP,WITH} carrying `HAS_ARG_FLAG` in
CPython's metadata. The autogen tool reads pseudo-opcode properties from
target instructions and does not propagate the pseudo's own
HAS_ARG flag, so PseudoOpcode::has_arg() omits these three opcodes.
Drop the debug_assert that fired inside py_freeze proc-macro expansion.

* Auto-generate has_eval_break and route AnyInstruction has_arg/has_const via macro

Add fn_has_eval_break to generate_rs_opcode_metadata.py using CPython's
Properties.eval_breaker, removing the hand-written matches! body for
Opcode::has_eval_break and PseudoOpcode::has_eval_break.

Forward has_arg/has_const from Instruction and PseudoInstruction to
their opcode, so AnyInstruction can use either_real_pseudo! like the
other has_* accessors instead of an open-coded match.
2026-05-28 09:19:11 +09:00
Bas Schoenmaeckers
ca412fce5d Add support for creating functions with the c-api (#7984) 2026-05-27 16:46:46 +09:00
Shahar Naveh
f95b7468f7 Autogen opcodes metadata (#7983) 2026-05-27 16:44:58 +09:00
Chanho Lee
1cb24c5ebb Reject non-ASCII digits in JSON numbers (#7982) 2026-05-27 16:40:52 +09:00
Jiseok CHOI
ce79cd4853 sqlite3: fix Blob.__setitem__ value range validation (#7981)
* sqlite3: fix Blob.__setitem__ value range validation

Previously, assigning an out-of-range integer (negative or > 255) or an
integer too large for i64 (e.g. 2**65) to a Blob index raised OverflowError
instead of ValueError.

Mirror CPython's ass_subscript_index logic:
- Convert the value via to_i64(), treating any overflow as -1
- Validate the result is in [0, 255], raising ValueError("byte must be in range(0, 256)") otherwise
- Separate deletion error messages: "item deletion" for index, "slice deletion" for slice

* sqlite3: fix Blob.__setitem__ negative-step slice write

In the step != 1 branch of Blob.ass_subscript, the loop used
  i_in_temp += step as usize
where step is isize. For negative steps (e.g. step = -2),
  (-2isize) as usize = 18446744073709551614
causing an out-of-bounds panic whenever slice_len >= 2.

Fix: use SaturatedSliceIter (already used by the read path) to iterate
over the correct absolute blob indices, then map each index back to a
temp buffer offset via abs_idx - range_start.

Also fix a Clippy lint: replace
  val < 0 || val > 255
with the idiomatic
  !(0..=255).contains(&val)

Add a regression test in extra_tests/snippets/stdlib_sqlite.py that
exercises blob[9:0:-2] (negative step, slice_len=5).

* fix: guard blob negative-step snippet from CPython 3.11 bug

* style: add blank line after import sys in stdlib_sqlite snippet (ruff)

* Update extra_tests/snippets/stdlib_sqlite.py

---------

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-05-27 16:40:05 +09:00
Bas Schoenmaeckers
dcb273ba68 Add capsule support to c-api (#7940) 2026-05-26 23:12:54 +09:00
Bas Schoenmaeckers
dd8d250ba3 Add list support to c-api (#7944)
* Add list support to c-api

* Review

* Fix Insert clamping
2026-05-26 23:12:01 +09:00
Shahar Naveh
3db172c025 Update ensurepip to 3.14.5 (#7860) 2026-05-26 23:11:43 +09:00
dependabot[bot]
fb531ecce3 Bump cranelift in the wasmtime group across 1 directory (#7980)
Bumps the wasmtime group with 1 update in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift` from 0.131.1 to 0.131.2
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

---
updated-dependencies:
- dependency-name: cranelift
  dependency-version: 0.131.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasmtime
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-26 10:37:02 +09:00
Shahar Naveh
9701c46d86 Clippy rules (test related) (#7968) 2026-05-25 22:03:18 +09:00
James Clarke
021c78655e docs: expand AGENTS.md with test marker guidance and CI audit notes (#7963)
* docs: expand AGENTS.md with test marker guidance and CI audit notes

Document the four-way test marker decision (expectedFailure /
expectedFailureIf vs skip / skipIf, with skip reserved for tests that
crash the interpreter), add guidance on avoiding zizmor's
impostor-commit audit when pinning third-party actions, link the wiki
guide for syncing tests from upstream CPython, and note the grep recipe
for finding WIP TODO: RUSTPYTHON entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: add pre-commit checks rule, trim CI section per review

Add a "CRITICAL: Pre-commit Checks" subsection requiring prek and the
full test suite to pass before any commit. Shrink the CI Workflows
section to a single sentence per @ShaharNaveh's review feedback:
contributors only need to know that workflow changes must pass a zizmor
scan in CI, not the full impostor-commit explainer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: warn against doc comments on pyattr/pyclass/pyfunction items

- Note that rustpython-doc supplies CPython docstrings via the derive macros
- Flag that `///` comments override that source and are dropped on `#[pyattr]`

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 22:02:22 +09:00
dependabot[bot]
411230a46c Bump j178/prek-action from 2.0.3 to 2.0.4 (#7973)
Bumps [j178/prek-action](https://github.com/j178/prek-action) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/j178/prek-action/releases)
- [Commits](6ad8027733...bdca6f102f)

---
updated-dependencies:
- dependency-name: j178/prek-action
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 21:20:30 +09:00
Shahar Naveh
b69644196a Upgrade pkcs8 to 0.11 (#7977) 2026-05-25 21:20:13 +09:00
dependabot[bot]
a6fee92683 Bump the wasmtime group across 1 directory with 2 updates (#7975)
Bumps the wasmtime group with 1 update in the / directory: [cranelift-jit](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift-jit` from 0.131.1 to 0.131.2
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

Updates `cranelift-module` from 0.131.1 to 0.131.2
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

---
updated-dependencies:
- dependency-name: cranelift-jit
  dependency-version: 0.131.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasmtime
- dependency-name: cranelift-module
  dependency-version: 0.131.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasmtime
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 18:40:48 +09:00
dependabot[bot]
f4696ea890 Bump peaceiris/actions-gh-pages from 4.0.0 to 4.1.0 (#7972)
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](4f9cc6602d...84c30a85c1)

---
updated-dependencies:
- dependency-name: peaceiris/actions-gh-pages
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 18:40:33 +09:00
dependabot[bot]
0237a1d520 Bump taiki-e/install-action from 2.77.6 to 2.79.1 (#7971)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.77.6 to 2.79.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](c070f87102...b550161ef8)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.79.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 18:40:17 +09:00
dependabot[bot]
6bbe24a725 Bump zizmorcore/zizmor-action from 0.5.3 to 0.5.6 (#7970)
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.3 to 0.5.6.
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](b1d7e1fb5d...5f14fd08f7)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 18:40:02 +09:00
dependabot[bot]
f9e4988cf5 Bump github/gh-aw from 0.73.0 to 0.74.4 (#7969)
Bumps [github/gh-aw](https://github.com/github/gh-aw) from 0.73.0 to 0.74.4.
- [Release notes](https://github.com/github/gh-aw/releases)
- [Changelog](https://github.com/github/gh-aw/blob/main/CHANGELOG.md)
- [Commits](4d44d0e898...2c1a237d20)

---
updated-dependencies:
- dependency-name: github/gh-aw
  dependency-version: 0.74.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-25 18:39:43 +09:00
James Clarke
a5775e0c07 Fix thread teardown panic when weakref callback fires during cleanup (#7965) 2026-05-25 13:55:32 +09:00
fanninpm
bc3d00e879 Replace ahash with rapidhash (#7954)
* Add `rapidhash` to list of dependencies

* Use `rapidhash::quality::RandomState` in `codegen` crate

* Use `rapidhash::quality::RandomState` in `stdlib` crate

* Use `rapidhash::quality::RandomState` in `vm` crate

* Remove `ahash` from lists of dependencies
2026-05-25 13:53:54 +09:00
Shahar Naveh
52305c0c72 Skip flaky test (#7967) 2026-05-24 20:00:32 +09:00
Shahar Naveh
7011942e4e Add builtin.PythonFinalizationError (#7966)
* Add PythonFinalizationError to builtins

* Patch failing tests (unrelated)

* Unmark passing test

* Update `exception_hierarchy.txt` to 3.14.5
2026-05-24 19:58:16 +09:00
dependabot[bot]
438925401f Bump qs and express in /wasm/demo (#7959)
Bumps [qs](https://github.com/ljharb/qs) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `qs` from 6.14.2 to 6.15.2
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.14.2...v6.15.2)

Updates `express` from 4.22.1 to 4.22.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/v4.22.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/v4.22.1...v4.22.2)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 4.22.2
  dependency-type: indirect
- dependency-name: qs
  dependency-version: 6.15.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-24 19:57:20 +09:00
Shahar Naveh
2fabf38d8f Impl sys.audithook (#7960)
* Update tests

* Add basic audit support

* Add audit for `time.sleep`

* Add some for `socket`

* Some syslog

* Some sys related audits

* some marshal

* monitoring callback

* Mark failing tests

* clippy

* Clippy

* clippy

* mark failing test

* mark more

* Update `test_sys_setprofile.py` to 3.14.5

* Mark failing tests
2026-05-24 19:56:35 +09:00
Shahar Naveh
d7d936575c General code nitpicks (#7955) 2026-05-24 19:55:22 +09:00
Jeong, YunWon
b5ff41c219 Align marshal and .pyc with CPython 3.14 (#7958)
* Share marshal ref table between code object and its internals

read_marshal_bytes, _str, _str_vec, _name_tuple, and _const_tuple now
take a shared ref table and resolve TYPE_REF / register FLAG_REF
entries. deserialize_code is split into a public wrapper and an inner
function that receives the ref table; deserialize_value_depth opens a
fresh inner ref space when it hits Type::Code, mirroring CPython's
behaviour of putting the code object itself at ref slot 0. Nested code
objects inside const tuples reuse the surrounding code's ref space via
the new read_const_value helper.

* Align PYC magic number, FORMAT_VERSION, and header check with CPython 3.14

PYC_MAGIC_NUMBER changes from 2994 to 3627, matching CPython 3.14's
pyc_magic_number_token (0x0a0d0e2b). marshal FORMAT_VERSION drops from
5 to 4 (the encoder/marshal.version value; the decoder already accepts
both). check_pyc_magic_number_bytes now compares all four magic bytes
instead of the first two.

* Add CPython 3.14 .pyc decoding regression tests

Two fixture-based tests pin the marshal decoder against actual CPython
3.14 marshal.dumps() output: a trivial module that exercises FLAG_REF
plus TYPE_REF for qualname, and a module with a nested function that
exercises ref sharing between a const tuple and its surrounding code
object.

* Accept CPython-tagged .pyc as read-only bytecode source

SourceFileLoader.get_code now also looks for .pyc files using
_RP_FALLBACK_CACHE_TAGS (currently ('cpython-314',)) in addition to
sys.implementation.cache_tag. The matched .pyc is only used for
reading; recompilation still writes to the RustPython-tagged path, so
CPython's .pyc is never overwritten. Source-stat / hash / timestamp
validation logic is unchanged.

* Apply rustfmt to marshal helpers

* Marshal PySlice from format version 4 instead of 5

CPython's marshal supports TYPE_SLICE from format version 4 onwards
and that is the default version. Rejecting slice dumps below version
5 made marshal.dumps(slice(...)) fail with the default version and
broke test.test_marshal.SliceTestCase.test_slice.

* Revert "Accept CPython-tagged .pyc as read-only bytecode source"

Lib/importlib/_bootstrap_external.py is CPython's own code copied
verbatim; local patches here defeat compatibility tracking. The
cpython-XX cache_tag fallback needs to live on the RustPython side
(Rust code or sys.implementation.cache_tag policy), not as edits to
the imported standard library.

This reverts commit 1fc426d0fb5fcdb50d35cad13bbb43e8f6ce1c7f.

* Format sys.implementation.cache_tag as cpython-{MAJOR}{MINOR}

Use the CPython compatibility version (e.g. cpython-314) instead of
the rustpython-{MAJOR_IMPL}_{MINOR_IMPL} interpreter version string.

* Set marshal FORMAT_VERSION to 5 to match CPython 3.14.5

Py_MARSHAL_VERSION is 5 in CPython 3.14.5 (Include/marshal.h:16) and
TYPE_SLICE serialization rejects version < 5 (Python/marshal.c:720).
Restore the same threshold and constant so marshal.version and the
slice-marshal gate match CPython.

* Thread marshal recursion depth through nested code objects

Code objects embedded in const-tuples reset the depth budget on each
recursion, so a hostile or pathological marshal stream of code-in-tuple-
in-code can blow the stack despite MAX_MARSHAL_STACK_DEPTH. Pass the
current depth through deserialize_code_inner and read_marshal_const_tuple
and decrement at each code-object/tuple boundary.

Also route dict keys through deserialize_value_after_header so TYPE_CODE
keys decode instead of failing with BadType.
2026-05-24 19:30:42 +09:00
Shahar Naveh
e1d9a1123e Skip flaky tests (#7961) 2026-05-24 13:48:00 +09:00