[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"] 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"] [build-dependencies] winresource = "0.1" [dependencies] rustpython-capi = { workspace = true, optional = true } rustpython-compiler = { workspace = 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 = "6" 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] criterion = { workspace = true } pyo3 = { workspace = true, features = ["auto-initialize"] } rustls-graviola = { workspace = true } rustpython-stdlib = { workspace = true } ruff_python_parser = { workspace = true } [[bench]] name = "execution" harness = false [[bench]] name = "microbenchmarks" harness = false [[bin]] name = "rustpython" path = "src/main.rs" [[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 [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", "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.0" authors = ["RustPython Team"] edition = "2024" rust-version = "1.95.0" repository = "https://github.com/RustPython/RustPython" license = "MIT" [workspace.dependencies] rustpython-capi = { path = "crates/capi", version = "0.6.0" } rustpython-compiler-core = { path = "crates/compiler-core", version = "0.6.0" } rustpython-compiler = { path = "crates/compiler", version = "0.6.0" } rustpython-codegen = { path = "crates/codegen", version = "0.6.0" } rustpython-common = { path = "crates/common", version = "0.6.0" } rustpython-host_env = { path = "crates/host_env", version = "0.6.0" } rustpython-derive = { path = "crates/derive", version = "0.6.0" } rustpython-derive-impl = { path = "crates/derive-impl", version = "0.6.0" } rustpython-jit = { path = "crates/jit", version = "0.6.0" } rustpython-literal = { path = "crates/literal", version = "0.6.0" } rustpython-vm = { path = "crates/vm", default-features = false, version = "0.6.0" } rustpython-pylib = { path = "crates/pylib", version = "0.6.0" } rustpython-stdlib = { path = "crates/stdlib", default-features = false, version = "0.6.0" } rustpython-sre_engine = { path = "crates/sre_engine", version = "0.6.0" } rustpython-unicode = { path = "crates/unicode", version = "0.6.0" } rustpython-wtf8 = { path = "crates/wtf8", version = "0.6.0" } rustpython-doc = { path = "crates/doc", version = "0.6.0" } # Use the RustPython Ruff fork for RustPython public `_ast` metadata. ruff_python_parser = { package = "rustpython-ruff_python_parser", version = "0.16.5" } ruff_python_ast = { package = "rustpython-ruff_python_ast", version = "0.16.5" } ruff_text_size = { package = "rustpython-ruff_text_size", version = "0.16.5" } ruff_source_file = { package = "rustpython-ruff_source_file", version = "0.16.5" } 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 } base64 = "0.23" 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.135.0" cranelift-jit = "0.135.0" cranelift-module = "0.135.0" 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" malachite-bigint = "0.12.0" malachite-q = "0.12.0" malachite-base = "0.12.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 } openssl = "0.10.80" openssl-sys = "0.9.110" optional = "0.5" parking_lot = "0.12.3" paste = "1.0.15" pem-rfc7468 = "1.0" pkcs8 = "0.11" proc-macro2 = "1.0.105" psm = "0.1" pymath = { version = "0.2.0", features = ["mul_add", "malachite-bigint", "complex"] } pyo3 = "0.29" 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 = "2" syn-ext = "0.5.0" system-configuration = "0.8.0" textwrap = { version = "0.16.2", default-features = false } termios = "0.3.3" thiserror = "2.0" thin-vec = "0.2.14" icu_casemap = "2" icu_locale = "2" icu_properties = "2" icu_normalizer = "2" uuid = "1.23.2" unicode_names2 = { version = "3", 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