Files
RustPython/crates/wasm/Cargo.toml
Jeong, YunWon be23b2c562 Store database docstrings xz-compressed behind an optional doc feature (#8836)
* Skip Python-defined classes when collecting builtin type docs

generate.py recorded every object.__subclasses__() entry as builtins.<name>
after importing the whole stdlib, so classes written in Python (tkinter,
unittest, tarfile, ...) ended up in the doc database. Classes that are
mutable heap types without C method descriptors and whose module is not a
C extension are now skipped, and their entries are removed from
data.inc.rs.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7

* Store database docstrings xz-compressed behind an optional doc feature

- rustpython-doc's build script compresses all database docstrings into
  one xz blob with an offset index; identical texts share one offset.
- Macros emit blob references for database docs; vm decompresses the
  blob on first access.
- New `doc` cargo feature (default on) in rustpython, rustpython-vm and
  rustpython-stdlib. Without it the blob and xz are not linked and
  database-backed __doc__ is None; __text_signature__ is unaffected.
- Native types without a docstring get __doc__ = None in their dict.
- Workflows that build with --no-default-features enable `doc` where
  tests or releases need docstrings.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
2026-09-27 20:45:45 +09:00

62 lines
2.1 KiB
TOML

[package]
name = "rustpython_wasm"
description = "A Python-3 (CPython >= 3.5.0) Interpreter written in Rust, compiled to WASM"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
license.workspace = true
[lib]
crate-type = ["cdylib", "rlib"]
[features]
default = ["freeze-stdlib", "doc"]
doc = ["rustpython-vm/doc", "rustpython-stdlib?/doc"]
freeze-stdlib = ["rustpython-vm/freeze-stdlib", "rustpython-pylib/freeze-stdlib", "rustpython-stdlib", "rustpython-stdlib/ssl"]
no-start-func = []
[dependencies]
rustpython-common = { workspace = true }
rustpython-pylib = { workspace = true, optional = true }
rustpython-stdlib = { workspace = true, default-features = false, optional = true, features = ["doc"] }
ruff_text_size = { workspace = true }
# make sure no threading! otherwise wasm build will fail
rustpython-vm = { workspace = true, features = ["compiler", "encodings", "serde", "wasmbind", "doc"] }
serde = { workspace = true }
wasm-bindgen = { workspace = true }
console_error_panic_hook = { workspace = true }
js-sys = { workspace = true }
serde-wasm-bindgen = { workspace = true }
wasm-bindgen-futures = { workspace = true }
web-sys = { workspace = true, features = [
"console",
"Document",
"Element",
"Window",
"Headers",
"Request",
"RequestInit",
"Response"
] }
[target.'cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))'.dependencies]
getrandom = { workspace = true, features = ["wasm_js"] }
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
rustls = { workspace = true, default-features = false, features = ["std", "tls12", "custom-provider"] }
rustls-pki-types = { version = "1", default-features = false, features = ["alloc", "std", "web"] }
rustls-rustcrypto = "0.0.2-alpha"
rustpython-host_env = { workspace = true, features = ["rustls"] }
[package.metadata.wasm-pack.profile.release]
wasm-opt = false#["-O1"]
[lints]
workspace = true
[package.metadata.cargo-shear]
ignored = ["serde", "getrandom", "rustls-pki-types"]