[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"] 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"] threading = ["rustpython-vm/threading", "rustpython-stdlib/threading"] sqlite = ["rustpython-stdlib/sqlite"] ssl = ["host_env"] 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"] [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, 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 } rustls-graviola = { workspace = true, optional = true } [target.'cfg(windows)'.dependencies] libc = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] rustyline = { workspace = true } [dev-dependencies] criterion = { workspace = true } pyo3 = { workspace = true, features = ["auto-initialize"] } 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-graviola", "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" [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.5.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.5.0" } rustpython-compiler-core = { path = "crates/compiler-core", version = "0.5.0" } rustpython-compiler = { path = "crates/compiler", version = "0.5.0" } rustpython-codegen = { path = "crates/codegen", version = "0.5.0" } rustpython-common = { path = "crates/common", version = "0.5.0" } rustpython-host_env = { path = "crates/host_env", version = "0.5.0" } rustpython-derive = { path = "crates/derive", version = "0.5.0" } rustpython-derive-impl = { path = "crates/derive-impl", version = "0.5.0" } rustpython-jit = { path = "crates/jit", version = "0.5.0" } rustpython-literal = { path = "crates/literal", version = "0.5.0" } rustpython-vm = { path = "crates/vm", default-features = false, version = "0.5.0" } rustpython-pylib = { path = "crates/pylib", version = "0.5.0" } rustpython-stdlib = { path = "crates/stdlib", default-features = false, version = "0.5.0" } rustpython-sre_engine = { path = "crates/sre_engine", version = "0.5.0" } rustpython-wtf8 = { path = "crates/wtf8", version = "0.5.0" } rustpython-doc = { path = "crates/doc", version = "0.5.0" } # Use RustPython-packaged Ruff crates from the published fork while keeping # existing crate names in the codebase. ruff_python_parser = { package = "rustpython-ruff_python_parser", version = "0.15.8" } ruff_python_ast = { package = "rustpython-ruff_python_ast", version = "0.15.8" } ruff_text_size = { package = "rustpython-ruff_text_size", version = "0.15.8" } ruff_source_file = { package = "rustpython-ruff_source_file", version = "0.15.8" } # To update ruff crates, comment out the above lines and uncomment the following lines to pull directly from the Ruff repository at the specified commit hash. # Ruff tag 0.15.8 is based on commit c2a8815842f9dc5d24ec19385eae0f1a7188b0d9 # at the time of this capture. We use the commit hash to ensure reproducible builds. # ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" } # ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" } # ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" } # ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "c2a8815842f9dc5d24ec19385eae0f1a7188b0d9" } der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] } phf = { version = "0.13.1", default-features = false, features = ["macros"]} adler32 = "1.2.0" approx = "0.5.1" ascii = "1.1" base64 = "0.22" blake2 = "0.10.4" bitflags = "2.11.0" bitflagset = "0.0.3" bstr = "1" bzip2 = "0.6" chrono = { version = "0.4.44", default-features = false, features = ["clock", "std"] } console_error_panic_hook = "0.1" constant_time_eq = "0.4" cranelift = "0.131.2" cranelift-jit = "0.131.2" cranelift-module = "0.131.0" crc32fast = "1.3.2" criterion = { version = "0.8", features = ["html_reports"] } crossbeam-utils = "0.8.21" csv-core = "0.1.11" digest = "0.10.7" dns-lookup = "3.0" dyn-clone = "1.0.10" exitcode = "1.1.2" flame = "0.2.2" flamer = "0.5" flate2 = { version = "1.1.9", default-features = false } # Bump only when the openssl crate bumps it foreign-types-shared = "0.1" gethostname = "1.0.2" getrandom = { version = "0.3", features = ["std"] } glob = "0.3" half = "2" hex = "0.4.3" hexf-parse = "0.2.1" hmac = "0.12" indexmap = { version = "2.14.0", features = ["std"] } insta = "1.47" itertools = "0.14.0" is-macro = "0.3.7" js-sys = "0.3" junction = "1.4.2" lexical-parse-float = "1.0.6" libc = "0.2.186" libffi = "5" libloading = "0.9" liblzma = "0.4" liblzma-sys = "0.4" libsqlite3-sys = "0.37" libz-rs-sys = "0.6" lock_api = "0.4" log = "0.4.29" lz4_flex = "0.13" 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.9.1" malachite-q = "0.9.1" malachite-base = "0.9.1" md-5 = "0.10.1" memchr = "2.8.0" memmap2 = "0.9.10" mt19937 = "<=3.2" # upgrade it once rand is upgraded 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 } oid-registry = "0.8" openssl = "0.10.80" openssl-sys = "0.9.110" openssl-probe = "0.2.1" optional = "0.5" parking_lot = "0.12.3" paste = "1.0.15" pbkdf2 = "0.12" 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.28" quote = "1.0.45" radium = "1.1.1" rand = "0.9" rand_core = { version = "0.9", features = ["os_rng"] } rapidhash = "4.4.1" result-like = "0.5.0" rustix = { version = "1.1", features = ["event", "param", "system"] } rustls = { version = "0.23.39", default-features = false } rustls-graviola = "0.3" rustls-native-certs = "0.8" rustls-pemfile = "2.2" rustls-platform-verifier = "0.7" rustyline = "18" serde = { package = "serde_core", version = "1.0.225", default-features = false, features = ["alloc"] } schannel = "0.1.29" scopeguard = "1" serde-wasm-bindgen = "0.6.5" sha-1 = "0.10.0" sha2 = "0.10.2" sha3 = "0.10.1" siphasher = "1" socket2 = "0.6.3" static_assertions = "1.1" strum = "0.28" strum_macros = "0.28" syn = "2" syn-ext = "0.5.0" system-configuration = "0.7.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" timsort = "0.1.2" 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.1" ucd = "0.1.1" unic-ucd-age = "0.9.0" unicode_names2 = "2.0.0" 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-cert = "0.2.5" x509-parser = "0.18" xml = "1.2" 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" redundant_test_prefix = "warn" std_instead_of_alloc = "warn" std_instead_of_core = "warn" tests_outside_test_module = "warn" # nursery lints to enforce gradually debug_assert_with_mut_call = "warn" derive_partial_eq_without_eq = "warn" imprecise_flops = "warn" or_fun_call = "warn" redundant_clone = "warn" search_is_some = "warn" single_option_map = "warn" trait_duplication_in_bounds = "warn" unused_peekable = "warn" unused_rounding = "warn" use_self = "warn" useless_let_if_seq = "warn" # pedantic lints to enforce gradually cloned_instead_of_copied = "warn" collapsible_else_if = "warn" comparison_chain = "warn" explicit_into_iter_loop = "warn" explicit_iter_loop = "warn" filter_map_next = "warn" flat_map_option = "warn" format_collect = "warn" from_iter_instead_of_collect = "warn" inconsistent_struct_constructor = "warn" inefficient_to_string = "warn" manual_is_variant_and = "warn" map_unwrap_or = "warn" must_use_candidate = "warn" redundant_else = "warn" uninlined_format_args = "warn" unnecessary_wraps = "warn" unnested_or_patterns = "warn"