claviron-python 0.2.7

Python embedded in Claviron: the interpreter, its environment and ASGI applications
[package]
name = "claviron-python"
version = "0.2.7"
edition = "2024"
license = "MIT"
repository = "https://github.com/claviron/python"
description = "Python embedded in Claviron: the interpreter, its environment and ASGI applications"
keywords = ["python", "asgi", "claviron", "embedding", "websocket"]
categories = ["web-programming::http-server", "api-bindings", "asynchronous"]
autotests = false
links = "claviron_python"
include = ["/src/**/*.rs", "/src/**/*.py", "/stubs/**/*.pyi", "/build.rs", "/Cargo.toml", "/README.md", "/LICENSE"]

[workspace]
resolver = "3"

[features]
default = []
# ASGI applications: lifespan, streaming HTTP, and the `claviron` module they
# import. Without it the crate starts and prepares the interpreter only.
asgi = [
    "claviron/http", "claviron/application", "claviron/orbit",
    "dep:bytes", "dep:http", "dep:http-body", "dep:http-body-util",
    "dep:percent-encoding", "dep:pyo3-async-runtimes", "dep:serde_json",
    "dep:tokio", "dep:tower-service", "dep:tracing",
]
broadcast = ["asgi", "dep:claviron-broadcast"]
django = ["broadcast", "dep:serde"]
log = ["asgi", "claviron/log-pipeline"]
# A WebSocket answered by the application, on a connection this process holds.
websocket = ["asgi", "claviron/websocket", "dep:claviron-transport", "claviron-transport/websocket-session"]
# `python:` on a site's routes and the one application `python.yaml` names, for
# an Edge or any host that compiles a site. No runner comes with it.
backend = ["websocket", "dep:async-trait", "dep:claviron-pipeline", "dep:serde", "dep:serde_yaml"]
edge = ["backend", "claviron/edge"]
# Native WebTransport sessions on an Edge's HTTP/3 listener, at the paths a
# `python:` route declares; each stream is one ASGI WebSocket connection.
webtransport = ["edge", "claviron/webtransport", "tokio/io-util"]

[dependencies]
bytes = { version = "1.11", optional = true }
claviron = { version = "0.2.5", default-features = false, features = ["runtime"] }
claviron-broadcast = { version = "0.2.1", optional = true }
claviron-pipeline = { version = "0.2.5", optional = true }
claviron-transport = { version = "0.2.5", optional = true }
async-trait = { version = "0.1", optional = true }
serde_yaml = { version = "0.9", optional = true }
http = { version = "1.4", optional = true }
http-body = { version = "1.0", optional = true }
http-body-util = { version = "0.1", optional = true }
percent-encoding = { version = "2.3", optional = true }
pyo3 = "0.30.1"
pyo3-async-runtimes = { version = "0.30.0", features = ["tokio-runtime"], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
thiserror = "2"
tokio = { version = "1", features = ["rt", "sync"], optional = true }
tracing = { version = "0.1", optional = true }
tower-service = { version = "0.3", optional = true }

[build-dependencies]
pyo3-build-config = { version = "0.30.1", features = ["resolve-config"] }

[dev-dependencies]
tempfile = "3"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

[[test]]
name = "interpreter_environment"
path = "tests/interpreter_environment.rs"