diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5a36fa..c44e604 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,4 +27,4 @@ jobs: uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Run tests - run: cargo test --locked -p biliup -p biliup-cli -p danmaku + run: cargo test --locked --workspace diff --git a/Cargo.lock b/Cargo.lock index af61efb..16477da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -533,21 +533,6 @@ dependencies = [ "urlencoding", ] -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - [[package]] name = "bit_field" version = "0.10.3" @@ -1409,17 +1394,6 @@ dependencies = [ "zune-inflate", ] -[[package]] -name = "fancy-regex" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72cf461f865c862bb7dc573f643dd6a2b6842f7c30b07882b56bd148cc2761b8" -dependencies = [ - "bit-set", - "regex-automata", - "regex-syntax", -] - [[package]] name = "fastrand" version = "2.4.1" @@ -4437,36 +4411,24 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" name = "stream-gears" version = "1.2.8" dependencies = [ - "async-channel", "async-trait", "axum", "biliup", "biliup-cli", "bon", - "bytes", - "chrono", "clap", "danmaku", "error-stack", - "fancy-regex", - "futures", - "mime_guess", "nom 8.0.0", - "ormlite", "pyo3", + "pyo3-build-config", "pythonize", - "rust-embed", - "serde", "serde_json", - "sqlx", - "thiserror 2.0.18", "time", "tokio", - "tower-http", "tracing", "tracing-appender", "tracing-subscriber", - "url", ] [[package]] diff --git a/crates/biliup-cli/Cargo.toml b/crates/biliup-cli/Cargo.toml index 9e07c07..a99eedc 100644 --- a/crates/biliup-cli/Cargo.toml +++ b/crates/biliup-cli/Cargo.toml @@ -78,9 +78,5 @@ struct-patch = "0.10.4" shellexpand = "3.1" dirs = "6.0" -[features] -default = [] -python-bridge = [] - [dev-dependencies] m3u8-rs = "6" diff --git a/crates/stream-gears/Cargo.toml b/crates/stream-gears/Cargo.toml index 0a424b3..1bce45a 100644 --- a/crates/stream-gears/Cargo.toml +++ b/crates/stream-gears/Cargo.toml @@ -8,35 +8,30 @@ edition = "2024" name = "stream_gears" crate-type = ["cdylib", "lib"] +[features] +default = ["extension-module"] +# Skips linking libpython so plain `cargo build` / `cargo test` work without Python dev files; +# `--no-default-features` is only needed for Rust tests that embed an interpreter. +extension-module = ["pyo3/extension-module"] + [dependencies] pyo3 = { version = "0.27.1", features = ["abi3-py39", "anyhow"] } pythonize = { version = "0.27.0" } -bytes = { workspace = true } -ormlite = { version = "0.24.1", features = ["sqlite", "chrono"] } -rust-embed = "8.7.2" -mime_guess = "2.0.5" axum = { version = "0.8", features = ["macros"] } -tower-http = { version = "0.6.2", features = ["cors"] } -sqlx = { version = "0.8", features = [ "runtime-tokio-rustls", "sqlite" ] } nom = "8" -serde = "1" serde_json = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } tracing-appender = { workspace = true } - -thiserror = { workspace = true } -futures = { workspace = true } -async-channel = { version = "2.5.0" } biliup = { path = "../biliup"} biliup-cli = { path = "../biliup-cli"} danmaku-client = { package = "danmaku", path = "../danmaku"} -url = { workspace = true } time = { workspace = true } -chrono = { workspace = true } -fancy-regex = { version = "0.17.0"} bon = { workspace = true } clap = { version = "4", features = ["derive"] } async-trait = { workspace = true } error-stack = { workspace = true } + +[build-dependencies] +pyo3-build-config = "0.27.1" diff --git a/crates/stream-gears/build.rs b/crates/stream-gears/build.rs new file mode 100644 index 0000000..dace4a9 --- /dev/null +++ b/crates/stream-gears/build.rs @@ -0,0 +1,3 @@ +fn main() { + pyo3_build_config::add_extension_module_link_args(); +}