Files
RustPython/Cargo.toml
T
youknowdotanddependabot[bot] 8c0c242dc8 Align profiler bindings and capability checks with Python 3.15 (#9340)
* Align offline profiler argument binding with Python 3.15

Accept the canonical keyword names for binary sample writes and native
context exits. Resolve the argument layout before numeric callbacks,
then preserve float-subclass payloads while accepting numeric protocols
for required and optional profile statistics.

AI-assisted source extraction, implementation, and source review with
OpenAI Codex. Runtime validation remains pending.

Assisted-by: OpenAI Codex:model version unavailable

* Restore the offline profiler capability flag

Preserve the original mega branch's zero-valued process_vm_readv
capability export. The native live unwinder remains unsupported; this
restores the public feature query without claiming live inspection support
or changing canonical test helpers.

AI-assisted source preservation and review with OpenAI Codex.

Assisted-by: OpenAI Codex:model version unavailable

* Restore finite-EOF table bounds for offline profiles

Match CPython's EOF-wide table count and decoding windows while retaining
checked offsets, allocation limits, cursor bounds, and replay checks.
This restores the original mega's finite-file contract without changing
canonical tests or the already validated argument-binding implementation.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve symtable warning exceptions and original filenames (#9282)

Keep warning-hook exceptions untouched instead of rewriting SyntaxError
subclasses. Thread the original Python filename through parser warning
emission and fresh warning-as-error SyntaxError construction, preserving
fsdecoded bytes paths and lone surrogates.

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

* build(deps): align the Cranelift 0.136 dependency family (#9341)

* build(deps): bump the wasmtime group across 1 directory with 2 updates

Bumps the wasmtime group with 2 updates in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime) and [cranelift-module](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift` from 0.135.2 to 0.136.3
- [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.135.3 to 0.136.3
- [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.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
- dependency-name: cranelift-module
  dependency-version: 0.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
...

Signed-off-by: dependabot[bot] <support@github.com>

* Align cranelift-jit with the 0.136 dependency family

Update cranelift-jit alongside cranelift and cranelift-module so the JIT shares their LibCall, FuncId, and Module trait identities. Regenerate only the affected dependency lock entries, preserving the original dependency PR changes.

AI assistance covered the dependency diagnosis, alignment, and static review.

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Support selective canonical function migration

Add hash-pinned function selection to the official Lib migration tool,
preserving canonical source bytes and rejecting ambiguous dependencies.

Assisted-by: OpenAI Codex:model version unavailable

* Detect CPython runtimes for canonical inspection feature checks

Add native runtime-cookie detection and import the exact Python 3.15
inspection helpers and tests through the official Lib migration tool.
Preserve the offline profiler argument and finite-EOF corrections.

Assisted-by: OpenAI Codex:model version unavailable

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-25 15:09:49 +09:00

451 lines
14 KiB
TOML

[package]
name = "rustpython"
description = "A python interpreter written in rust."
include = ["LICENSE", "Cargo.toml", "src/**/*.rs"]
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license.workspace = true
[features]
capi = ["dep:rustpython-capi", "threading"]
default = ["threading", "stdlib", "stdio", "importlib", "ssl-rustls-aws-lc", "host_env", "mimalloc", "doc", "ucd_3_2_0"]
doc = ["rustpython-vm/doc", "rustpython-stdlib?/doc"]
mimalloc = ["dep:mimalloc"]
host_env = ["rustpython-vm/host_env", "rustpython-stdlib?/host_env"]
importlib = ["rustpython-vm/importlib"]
encodings = ["rustpython-vm/encodings"]
stdio = ["rustpython-vm/stdio"]
stdlib = ["rustpython-stdlib", "rustpython-pylib", "encodings"]
flame-it = ["rustpython-vm/flame-it", "rustpython-stdlib/flame-it", "flame", "flamescope"]
freeze-stdlib = ["stdlib", "rustpython-vm/freeze-stdlib", "rustpython-pylib?/freeze-stdlib"]
jit = ["rustpython-vm/jit"]
opcode-histogram = ["rustpython-vm/opcode-histogram"]
threading = ["rustpython-vm/threading", "rustpython-stdlib/threading"]
sqlite = ["rustpython-stdlib/sqlite"]
ssl = ["host_env", "rustpython-stdlib?/ssl"]
ssl-rustls = ["ssl", "rustpython-stdlib/ssl-rustls"]
ssl-rustls-aws-lc = ["ssl-rustls", "dep:rustls", "rustls/aws_lc_rs"]
ssl-rustls-aws-lc-fips = ["ssl-rustls-aws-lc", "rustls/fips"]
ssl-openssl = ["ssl", "rustpython-stdlib/ssl-openssl"]
ssl-openssl-vendor = ["ssl-openssl", "rustpython-stdlib/ssl-openssl-vendor"]
tkinter = ["rustpython-stdlib/tkinter"]
ucd_3_2_0 = ["rustpython-stdlib?/ucd_3_2_0"]
[build-dependencies]
winresource = "0.1"
[dependencies]
rustpython-capi = { workspace = true, optional = true }
rustpython-pylib = { workspace = true, optional = true }
rustpython-stdlib = { workspace = true, optional = true, default-features = false, features = ["compiler"] }
rustpython-vm = { workspace = true, features = ["compiler", "gc"] }
log = { workspace = true }
flame = { workspace = true, optional = true }
lexopt = "0.3"
dirs = "7"
env_logger = "0.11"
flamescope = { version = "0.1.2", optional = true }
rustls = { workspace = true, optional = true }
[target.'cfg(windows)'.dependencies]
libc = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rustyline = { workspace = true }
mimalloc = { version = "0.1", optional = true, default-features = false }
[dev-dependencies]
rustpython-compiler = { workspace = true }
criterion = { workspace = true }
pyo3 = { workspace = true, features = ["auto-initialize"] }
rustls-graviola = { workspace = true }
rustpython-stdlib = { workspace = true }
ruff_python_parser = { workspace = true }
# Only the criterion benchmarks below are measured. Without `bench = false`,
# `cargo bench` (and `cargo codspeed build`) also builds the library and binary
# unit-test harnesses with the LTO bench profile, adding a full extra link of
# the interpreter that is never run.
[lib]
bench = false
[[bench]]
name = "execution"
harness = false
[[bench]]
name = "microbenchmarks"
harness = false
[[bin]]
name = "rustpython"
path = "src/main.rs"
bench = false
[[example]]
name = "custom_tls_providers"
path = "examples/custom_tls_providers.rs"
required-features = [
"rustls/ring",
"rustpython-pylib/freeze-stdlib",
"rustpython-stdlib/ssl-rustls",
"rustpython-vm/freeze-stdlib",
]
[profile.dev.package."*"]
opt-level = 3
# Unoptimized opcode dispatch leaves oversized native frames active during
# imports and callbacks. Keep the evaluator compact without changing dev guards.
[profile.dev.package.rustpython-vm]
opt-level = 3
[profile.test]
opt-level = 3
# https://github.com/rust-lang/rust/issues/92869
# lto = "thin"
# Some crates don't change as much but benefit more from
# more expensive optimization passes, so we selectively
# decrease codegen-units in some cases.
[profile.release.package.rustpython-doc]
codegen-units = 1
[profile.release.package.rustpython-literal]
codegen-units = 1
[profile.release.package.rustpython-common]
codegen-units = 1
[profile.release.package.rustpython-wtf8]
codegen-units = 1
[profile.bench]
lto = "thin"
codegen-units = 1
opt-level = 3
[profile.release]
lto = "thin"
[profile.wasm-release]
inherits = "release"
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"
[patch.crates-io]
parking_lot_core = { git = "https://github.com/youknowone/parking_lot", branch = "rustpython" }
# REDOX START, Uncomment when you want to compile/check with redoxer
# REDOX END
[package.metadata.packager]
product-name = "RustPython"
identifier = "com.rustpython.rustpython"
description = "An open source Python 3 interpreter written in Rust"
homepage = "https://rustpython.github.io/"
license_file = "LICENSE"
authors = ["RustPython Team"]
publisher = "RustPython Team"
resources = ["LICENSE", "crates/pylib/LICENSE-profiling", "README.md", "Lib"]
icons = ["32x32.png"]
[package.metadata.packager.nsis]
installer_mode = "both"
template = "installer-config/installer.nsi"
[package.metadata.packager.wix]
template = "installer-config/installer.wxs"
[workspace]
resolver = "2"
members = [
".",
"crates/*",
]
exclude = ["pymath"]
[workspace.package]
version = "0.6.1"
authors = ["RustPython Team"]
edition = "2024"
rust-version = "1.99.0"
repository = "https://github.com/RustPython/RustPython"
license = "MIT"
[workspace.dependencies]
rustpython-capi = { path = "crates/capi", version = "0.6.1" }
rustpython-compiler-core = { path = "crates/compiler-core", version = "0.6.1" }
rustpython-compiler = { path = "crates/compiler", version = "0.6.1" }
rustpython-codegen = { path = "crates/codegen", version = "0.6.1" }
rustpython-common = { path = "crates/common", version = "0.6.1" }
rustpython-host_env = { path = "crates/host_env", version = "0.6.1" }
rustpython-derive = { path = "crates/derive", version = "0.6.1" }
rustpython-derive-impl = { path = "crates/derive-impl", version = "0.6.1" }
rustpython-jit = { path = "crates/jit", version = "0.6.1" }
rustpython-literal = { path = "crates/literal", version = "0.6.1" }
rustpython-vm = { path = "crates/vm", default-features = false, version = "0.6.1" }
rustpython-pylib = { path = "crates/pylib", version = "0.6.1" }
rustpython-stdlib = { path = "crates/stdlib", default-features = false, version = "0.6.1" }
rustpython-sre_engine = { path = "crates/sre_engine", version = "0.6.1" }
rustpython-unicode = { path = "crates/unicode", default-features = false, version = "0.6.1" }
rustpython-wtf8 = { path = "crates/wtf8", version = "0.6.1" }
rustpython-doc = { path = "crates/doc", version = "0.6.1" }
# Use the RustPython Ruff fork for RustPython public `_ast` metadata.
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", rev = "9290a8849542134d83f77e9360e7f0b93897fd93" }
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", rev = "9290a8849542134d83f77e9360e7f0b93897fd93" }
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", rev = "9290a8849542134d83f77e9360e7f0b93897fd93" }
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", rev = "9290a8849542134d83f77e9360e7f0b93897fd93" }
der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
phf = { version = "0.14.0", default-features = false, features = ["macros"]}
adler32 = "1.2.0"
approx = "0.5.1"
ascii = { version = "1.1", default-features = false }
blake2b_simd = "1.0.4"
blake2s_simd = "1.0.4"
bitflags = "2.11.0"
bitflagset = "0.0.4"
bstr = { version = "1", default-features = false, features = ["unicode"] }
bzip2 = "0.6"
console_error_panic_hook = "0.1"
constant_time_eq = "0.6"
cranelift = "0.136.3"
cranelift-jit = "0.136.3"
cranelift-module = "0.136.3"
crc32fast = "1.3.2"
criterion = { package = "codspeed-criterion-compat", version = "5.0.1", features = ["html_reports"] }
crossbeam-utils = "0.8.21"
dns-lookup = "4.0"
flame = "0.2.2"
flamer = "0.5"
# Bump only when the openssl crate bumps it
foreign-types-shared = "0.1"
gethostname = "1.0.2"
getrandom = { version = "0.4", features = ["std"] }
glob = "0.3"
half = "2"
hex = "0.4.3"
hexf-parse = "0.2.1"
indexmap = { version = "2.14.0", features = ["std"] }
insta = "1.47"
itertools = { version = "0.15.0", default-features = false, features = ["use_alloc"] }
itoa = "1"
is-macro = "0.3.7"
jiff = "0.2"
js-sys = "0.3"
junction = "2.0.0"
lexical-parse-float = "1.0.6"
libc = "0.2.186"
libffi = "5"
libloading = "0.9"
xz = "0.4.6-rc.0"
xz-sys = "0.4.6-rc.0"
libsqlite3-sys = "0.38"
libz-rs-sys = "0.6"
zlib-rs = { version = "=0.6.8", default-features = false, features = ["rust-allocator", "__internal-api"] }
lock_api = "0.4"
log = "0.4.30"
lz4_flex = "0.14"
nix = { version = "0.31", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] }
mac_address = "1.1.3"
mach2 = "0.4.3"
malachite-bigint = "0.14.0"
malachite-q = "0.14.0"
malachite-base = "0.14.0"
md-5 = "0.11"
memchr = { version = "2.8.1", default-features = false, features = ["alloc"] }
memmap2 = "0.9.10"
mt19937 = "3.3"
num-complex = "0.4.6"
num-integer = "0.1.46"
num-traits = "0.2"
num_cpus = "1.17.0"
num_enum = { version = "0.7", default-features = false }
object = { version = "0.37.3", default-features = false, features = ["read_core", "elf", "macho", "pe", "std", "unaligned"] }
openssl = "0.10.80"
openssl-sys = "0.9.110"
optional = "0.5"
parking_lot = "0.12.3"
parking_lot_core = "0.9.12"
paste = "1.0.15"
pem-rfc7468 = "1.0"
pkcs8 = "0.11"
proc-macro2 = "1.0.105"
psm = "0.1"
pymath = { git = "https://github.com/RustPython/pymath.git", rev = "dd1e9a4cf26d68caf3b549c09476f52e356e16a3", features = ["mul_add", "malachite-bigint", "complex"] }
pyo3 = "0.30"
quote = "1.0.45"
radium = "1.1.1"
rand = "0.10"
rapidhash = "4.4.1"
result-like = "0.5.0"
rustix = { version = "1.1", features = ["event", "fs", "param", "system"] }
rustls = { version = "0.23.39", default-features = false }
rustls-graviola = "0.4"
rustls-native-certs = "0.8"
rustls-pemfile = "2.2"
rustls-webpki = { version = "0.103", default-features = false, features = ["std"] }
rustyline = "18"
serde = { package = "serde_core", version = "1.0.225", default-features = false, features = ["alloc"] }
schannel = "0.1.29"
scopeguard = "1"
scrypt = { version = "0.12", default-features = false }
serde-wasm-bindgen = "0.6.5"
sha1 = "0.11"
sha2 = "0.11"
sha3 = "0.12"
shake = "0.1"
siphasher = "1"
socket2 = "0.6.4"
static_assertions = "1.1"
strum = "0.28"
strum_macros = "0.28"
syn = "3"
system-configuration = "0.8.0"
tcl-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0" }
textwrap = { version = "0.16.2", default-features = false }
termios = "0.3.3"
thiserror = "2.0"
thin-vec = "0.2.14"
tk-sys = { git = "https://github.com/arihant2math/tkinter.git", tag = "v0.2.0" }
icu_casemap = "2"
icu_locale = "2"
icu_properties = "2"
icu_normalizer = "2"
uuid = "1.23.2"
unicode_names2 = { version = "4", default-features = false, features = ["no_std"] }
widestring = "1.2.0"
windows-sys = "0.61.2"
wasm-bindgen = "0.2.106"
wasm-bindgen-futures = "0.4"
web-sys = "0.3"
webpki-roots = "1.0"
which = "8"
x509-parser = "0.18"
xml = "1.3"
writeable = "0.6"
# Lints
[workspace.lints.rust]
unsafe_code = "allow"
unsafe_op_in_unsafe_fn = "deny"
elided_lifetimes_in_paths = "warn"
unreachable_pub = "warn"
[workspace.lints.clippy]
correctness = { level = "warn", priority = -2 }
suspicious = { level = "warn", priority = -2 }
perf = { level = "warn", priority = -2 }
style = { level = "warn", priority = -2 }
complexity = { level = "warn", priority = -2 }
# pedantic = { level = "warn", priority = -2 } # TODO: Enable this
missing_errors_doc = "allow" # Too many errors. No auto-fix available
missing_panics_doc = "allow" # Too many errors. No auto-fix available
match_same_arms = "allow" # Not always more readable
if_not_else = "allow" # Not always more readable
single_match_else = "allow"
similar_names = "allow"
# restriction lints
alloc_instead_of_core = "warn"
cfg_not_test = "warn"
iter_over_hash_type = "warn"
redundant_test_prefix = "warn"
std_instead_of_alloc = "warn"
std_instead_of_core = "warn"
tests_outside_test_module = "warn"
# nursery lints to enforce gradually
collection_is_never_read = "warn"
debug_assert_with_mut_call = "warn"
derive_partial_eq_without_eq = "warn"
imprecise_flops = "warn"
iter_on_empty_collections = "warn"
iter_on_single_items = "warn"
literal_string_with_formatting_args = "warn"
needless_collect = "warn"
or_fun_call = "warn"
redundant_clone = "warn"
search_is_some = "warn"
significant_drop_in_scrutinee = "warn"
single_option_map = "warn"
trait_duplication_in_bounds = "warn"
tuple_array_conversions = "warn"
type_repetition_in_bounds = "warn"
unnecessary_struct_initialization = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
use_self = "warn"
useless_let_if_seq = "warn"
while_float = "warn"
# pedantic lints to enforce gradually
assigning_clones = "warn"
bool_to_int_with_if = "warn"
checked_conversions = "warn"
cloned_instead_of_copied = "warn"
collapsible_else_if = "warn"
comparison_chain = "warn"
copy_iterator = "warn"
doc_link_with_quotes = "warn"
duration_suboptimal_units = "warn"
elidable_lifetime_names = "warn"
enum_glob_use = "warn"
explicit_deref_methods = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
format_collect = "warn"
inconsistent_struct_constructor = "warn"
index_refutable_slice = "warn"
inefficient_to_string = "warn"
ip_constant = "warn"
iter_filter_is_ok = "warn"
iter_filter_is_some = "warn"
large_futures = "warn"
large_types_passed_by_value = "warn"
manual_assert = "warn"
manual_instant_elapsed = "warn"
manual_is_variant_and = "warn"
map_unwrap_or = "warn"
match_bool = "warn"
mismatching_type_param_order = "warn"
must_use_candidate = "warn"
mut_mut = "warn"
needless_bitwise_bool = "warn"
needless_for_each = "warn"
non_std_lazy_statics = "warn"
option_as_ref_cloned = "warn"
ptr_offset_by_literal = "warn"
range_minus_one = "warn"
range_plus_one = "warn"
redundant_else = "warn"
ref_option = "warn"
return_self_not_must_use = "warn"
same_functions_in_if_condition = "warn"
single_char_pattern = "warn"
trivially_copy_pass_by_ref = "warn"
unchecked_time_subtraction = "warn"
uninlined_format_args = "warn"
unnecessary_box_returns = "warn"
unnecessary_join = "warn"
unnecessary_wraps = "warn"
unnested_or_patterns = "warn"
[lints]
workspace = true