384 Commits

Author SHA1 Message Date
Jeong, YunWon
1385c4e472 rename ssl-vendor (#7989) 2026-05-28 09:37:44 +03: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
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
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
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
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
dependabot[bot]
a6f13b98fb Bump openssl from 0.10.79 to 0.10.80 (#7931)
Bumps [openssl](https://github.com/rust-openssl/rust-openssl) from 0.10.79 to 0.10.80.
- [Release notes](https://github.com/rust-openssl/rust-openssl/releases)
- [Commits](https://github.com/rust-openssl/rust-openssl/compare/openssl-v0.10.79...openssl-v0.10.80)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.80
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-20 23:10:08 +09:00
Joshua Megnauth
e16f1aa657 Use correct dirs crate; drop uname for rustix (#7906)
RustPython used an ancient, unmaintained version of the `dirs` crate.
This pulled in `winapi-rs` on Windows, which is an old crate that has
been deprecated in favor of `windows-rs`. `windows-rs` is maintained by
Microsoft. Bumping `dirs` to the latest version removes more `winapi-rs`
from Cargo.lock.

As for `uname`, `rustix` handles it safely so the additional crate isn't
needed.
2026-05-19 13:27:32 +09:00
Joshua Megnauth
ab72b292bd rustix/windows-sys for page size; drop maplit (#7876)
The `page_size` crate is a simple libc wrapper for Unix and uses
`winapi-rs` for Windows. `windows-sys` and `windows-rs` are the modern
alternatives for the unmaintained `winapi-rs`. Both crates are
maintained by Microsoft - they're official. Getting the page size is a
simple call for both Unix and Windows.

Besides Unix and Windows, I also added the page size for wasm32 which
the `page_size` crate did not support. `wasm32`'s page size is a
constant that is defined by the spec, so I hard coded it without adding
additional dependencies.

Finally, I dropped `maplit` which is seven years old and only used in
one place. Calling `collect()` with a single item iterator is idiomatic
as well as better in this case because Rust can optimize it. `maplit`
called `HashMap::insert` which over allocates to amortize future allocs.
2026-05-17 20:47:13 +09:00
Jeong, YunWon
8253253fc7 more hostenv impl (#7604) 2026-05-16 19:01:40 +09:00
Joshua Megnauth
078e23de27 Use icu4x for casefold() (#7780) 2026-05-16 12:59:49 +09:00
Shahar Naveh
ddfcb25957 Clippy nursery lints (#7875) 2026-05-15 10:38:36 +00:00
fanninpm
e467b67ef7 Move dependencies to workspace for compiler-core crate (#7874)
* Add dependency from `compiler-core` crate to workspace

* Declare dependency as workspace = true
2026-05-15 16:52:31 +09:00
Shahar Naveh
460b1d39ed Clippy warn uninlined_format_args & redundant_else (#7873) 2026-05-15 16:52:06 +09:00
Shahar Naveh
e8711edd2d Clippy warn on unnecessary wraps (#7869) 2026-05-13 23:14:33 +09:00
fanninpm
7ebffd063b Move dependencies to workspace for wasm crate (#7794)
* Add dependencies from `wasm` crate to workspace

* Declare dependencies as workspace = true
2026-05-13 03:12:22 +00:00
Shahar Naveh
9d77b25858 Add more pedantic clippy rules (#7830) 2026-05-12 20:57:37 +09:00
dependabot[bot]
9e066c4f50 Bump cranelift in the wasmtime group across 1 directory (#7842)
Bumps the wasmtime group with 1 update in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift` from 0.131.0 to 0.131.1
- [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.1
  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-12 20:48:57 +09:00
dependabot[bot]
3b67d0f5d2 Bump libz-rs-sys from 0.5.5 to 0.6.0 (#7843)
Bumps [libz-rs-sys](https://github.com/trifectatechfoundation/zlib-rs) from 0.5.5 to 0.6.0.
- [Release notes](https://github.com/trifectatechfoundation/zlib-rs/releases)
- [Changelog](https://github.com/trifectatechfoundation/zlib-rs/blob/main/docs/release.md)
- [Commits](https://github.com/trifectatechfoundation/zlib-rs/compare/v0.5.5...v0.6.0)

---
updated-dependencies:
- dependency-name: libz-rs-sys
  dependency-version: 0.6.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-12 20:48:28 +09:00
Shahar Naveh
d6abdc4b79 Fixed: unused manifest key: dependencies.libz-sys.package (#7792)
* Fixed: `unused manifest key: dependencies.libz-sys.package`

* Use `libz-rs-sys` instead

* Adjust rust code
2026-05-12 00:54:44 +09:00
Shahar Naveh
4a46e84eb9 Add map_unwrap_or clippy rule (#7829) 2026-05-12 00:51:23 +09:00
Joshua Megnauth
108461f637 Fix title() and capitalize() (#7717)
* PyBytes.title should be ASCII-only.

* Use icu_casemap over unicode-casing for titles

`icu_casemap` is consistently maintained, official, and tracks the
latest Unicode versions. RustPython is also using other `icu4x` crates,
so using `icu_casemap` is more consistent.

As with islower and isupper, tracking the latest Unicode version is
important because character definitions shift over time which causes
discrepancies between RustPython and CPython.

This commit fixes title().

* Use icu_casemap for capitalize()

I dropped unicode-casing because it's cleaner to use icu4x for
everything. `icu4x` will also stay up to date whereas unicode-casing
will need to be periodically updated with new Unicode tables. Dropping
unicode-casing also removes some binary bloat due to the tables.

`capitalize()` mimics CPython behavior more closely now as well.
Notably, I implemented CPython's sigma edge case handler.

* Match CPython's title() exactly
2026-05-09 18:03:21 +00:00
fanninpm
bf7bb1bf3b Move dependencies to workspace for capi crate (#7795)
* Add dependency from `capi` crate to workspace

* Declare dependency as workspace = true

* Update Cargo.toml

Co-authored-by: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com>

---------

Co-authored-by: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com>
Co-authored-by: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com>
2026-05-10 00:31:37 +09:00
Joshua Megnauth
4aa73ddab2 Use rustix for uname; drop uname crate (#7799) 2026-05-10 00:26:26 +09:00
dependabot[bot]
e10a27b1ae Bump openssl from 0.10.78 to 0.10.79 (#7791)
Bumps [openssl](https://github.com/rust-openssl/rust-openssl) from 0.10.78 to 0.10.79.
- [Release notes](https://github.com/rust-openssl/rust-openssl/releases)
- [Commits](https://github.com/rust-openssl/rust-openssl/compare/openssl-v0.10.78...openssl-v0.10.79)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.79
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-06 20:44:10 +09:00
fanninpm
1c4361803d Move dependencies to workspace for vm crate (#7789)
* Add dependencies from `vm` crate to workspace

* Declare dependencies as workspace = true
2026-05-06 14:03:05 +09:00
Bas Schoenmaeckers
22d4f43ad4 Add minimal capi lifecycle support (#7648)
* Add minimal capi lifecycle support

* Force enable `threading` on `stdlib`

---------

Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
2026-05-06 02:02:26 +09:00
dependabot[bot]
a5cebc3242 Bump the wasmtime group across 1 directory with 2 updates (#7775)
Bumps the wasmtime group with 1 update in the / directory: [cranelift-jit](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift-jit` from 0.131.0 to 0.131.1
- [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.0 to 0.131.1
- [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.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: wasmtime
- dependency-name: cranelift-module
  dependency-version: 0.131.1
  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-05 14:22:02 +09:00
fanninpm
e4d35b08ea Move dependencies to workspace for common crate (#7771)
* Add dependencies from `common` crate to workspace

* Declare dependencies as workspace = true
2026-05-05 14:02:57 +09:00
Shahar Naveh
ee5e9d0001 Enable some pedantic clippy lints (#7764) 2026-05-04 10:25:37 +09:00
Shahar Naveh
eb99a8ecf1 Warn on unreachable_pub (#7762) 2026-05-04 10:18:24 +09:00
fanninpm
acc167fc44 Move dependencies to workspace for stdlib crate (#7747)
* Add dependencies from `stdlib` crate to workspace

* Declare dependencies as workspace = true
2026-05-04 09:50:21 +09:00
Shahar Naveh
926d69b50a Add some clippy lints (#7755) 2026-05-02 11:14:23 +09:00
fanninpm
88be7bb16a Move dependencies to workspace for literal crate (#7739)
* Add dependencies from `literal` crate to main workspace

* Declare dependencies as workspace = true
2026-04-30 10:24:50 +03:00
fanninpm
51e7200d11 Move dependencies to workspace for jit crate (#7720)
* Add dependencies from `jit` crate to main workspace

* Declare dependencies as workspace = true
2026-04-29 18:15:01 +09:00
fanninpm
d7a319d967 Move dependency to workspace for host_env crate (#7719)
* Add dependency from `host_env` crate to main workspace

* Declare dependency as workspace = true
2026-04-29 18:14:51 +09:00
dependabot[bot]
82e8b200db Bump the unix group across 1 directory with 2 updates (#7713)
Bumps the unix group with 2 updates in the / directory: [nix](https://github.com/nix-rust/nix) and [rustyline](https://github.com/kkawakam/rustyline).


Updates `nix` from 0.30.1 to 0.31.2
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.30.1...v0.31.2)

Updates `rustyline` from 17.0.2 to 18.0.0
- [Release notes](https://github.com/kkawakam/rustyline/releases)
- [Changelog](https://github.com/kkawakam/rustyline/blob/master/History.md)
- [Commits](https://github.com/kkawakam/rustyline/compare/v17.0.2...v18.0.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-version: 0.31.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: unix
- dependency-name: rustyline
  dependency-version: 18.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: unix
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-29 18:14:09 +09:00
fanninpm
363d19839f Move dependencies to workspace for derive-impl crate (#7710)
* Add dependencies from `derive-impl` crate to main workspace

* Declare dependencies as workspace = true
2026-04-28 21:12:31 +09:00
dependabot[bot]
e6d9ea6bfe Bump insta from 1.46.3 to 1.47.2 (#7706)
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.46.3 to 1.47.2.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.46.3...1.47.2)

---
updated-dependencies:
- dependency-name: insta
  dependency-version: 1.47.2
  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-04-28 21:11:08 +09:00
Shahar Naveh
5648a3346f Upgrade der to 0.8 (#7695)
* Update `der` to 0.8, move to workspace dependencies

* Add `pem` feature
2026-04-27 21:37:42 +09:00
dependabot[bot]
02c454bdb4 Bump libc from 0.2.185 to 0.2.186 (#7694)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.185 to 0.2.186.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.186/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.185...0.2.186)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.186
  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-04-27 12:38:06 +09:00
Shahar Naveh
0d67fd69e2 Relax rustyline version constraint (#7672) 2026-04-25 00:07:17 +09:00
dependabot[bot]
43ef2eabbe Bump indexmap from 2.13.0 to 2.14.0 (#7666) 2026-04-24 07:54:37 -04:00
Shahar Naveh
dc65255fd2 Use cfg_select! (#7636) 2026-04-21 17:35:26 +00:00
Pravin
a9fd4bf41f Bump rust version to 1.94.0 (#7442) 2026-04-22 00:01:09 +09:00
Copilot
d5921d16af Create rustpython-host-env (#7582)
* Create rustpython-host-env crate; move host abstractions out of common

Move os, crt_fd, fileutils, windows, macros modules from
rustpython-common into the new rustpython-host-env crate.
This isolates host OS API wrappers behind a crate boundary
with zero Python runtime dependency.

- Add crates/host_env to workspace
- Drop nix, windows-sys, widestring deps from common
- Wire vm and stdlib to depend on rustpython-host-env
- Migrate all imports from common::{os,crt_fd,fileutils,windows}
  to rustpython_host_env::

* refactor: extract host helpers

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/48d1e64d-37ce-409f-b511-8e61a349665c

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* lint: enforce direct host API boundaries

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/97225fb7-7b3d-4197-a77c-eb44aead5b13

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* refactor: extract remaining host env helpers

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/d96f57e1-b196-4460-9983-97d5ff118835

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* fix: clean extracted host env follow-up

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/d96f57e1-b196-4460-9983-97d5ff118835

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* fix: document env mutation safety

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/d96f57e1-b196-4460-9983-97d5ff118835

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* refactor: split host fs helpers from fileutils

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/c57424c5-0e1d-490a-82b3-2d2f6c8cf2cd

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* fix: resolve latest host env ci regressions

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/899eb717-ebc6-4a4a-870c-2a15c5f33e02

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* fix: resolve remaining windows clippy host fs calls

Agent-Logs-Url: https://github.com/RustPython/RustPython/sessions/12f32740-8173-4b10-a1d6-00b29e90a8ec

Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>

* host_env

---------

Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
2026-04-21 00:13:25 +09:00
ShaharNaveh
da01e617de Update libc to 0.2.185 2026-04-14 21:00:12 +09:00
Shahar Naveh
3d9688402a Replace unmaintained unic crates (#7555) 2026-04-03 01:43:11 +09:00