Compare commits

...

3 Commits

Author SHA1 Message Date
15f08a8cfb
0.8.3 dev 2025-02-13 01:31:36 +08:00
2b1c366643
remove some tokio feature 2025-02-13 01:29:54 +08:00
a63423d545
fmt 2025-02-13 00:05:56 +08:00
5 changed files with 34 additions and 59 deletions

51
Cargo.lock generated
View File

@ -693,7 +693,7 @@ dependencies = [
[[package]]
name = "ica-rs"
version = "0.8.2"
version = "0.8.3"
dependencies = [
"anyhow",
"base64 0.22.1",
@ -927,16 +927,6 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]]
name = "lock_api"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.25"
@ -1111,29 +1101,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "parking_lot"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-targets",
]
[[package]]
name = "percent-encoding"
version = "2.3.1"
@ -1300,15 +1267,6 @@ dependencies = [
"getrandom 0.2.15",
]
[[package]]
name = "redox_syscall"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
dependencies = [
"bitflags",
]
[[package]]
name = "reqwest"
version = "0.12.12"
@ -1507,12 +1465,6 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "security-framework"
version = "2.11.1"
@ -1856,7 +1808,6 @@ dependencies = [
"bytes",
"libc",
"mio",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",

View File

@ -1,6 +1,6 @@
[package]
name = "ica-rs"
version = "0.8.2"
version = "0.8.3"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -40,7 +40,7 @@ toml_edit = "0.22"
colored = "3.0"
# runtime
tokio = { version = "1.43", features = ["full"] }
tokio = { version = "1.43", features = ["rt-multi-thread", "time", "signal", "macros"] }
futures-util = "0.3"
pyo3 = { version = "0.23", features = ["experimental-async", "py-clone"] }
anyhow = { version = "1.0", features = ["backtrace"] }

View File

@ -9,6 +9,7 @@ mod data_struct;
mod error;
mod py;
mod status;
mod wasms;
#[cfg(feature = "ica")]
mod ica;
@ -79,7 +80,7 @@ pub fn version_str() -> String {
/// 是否为稳定版本
/// 会在 release 的时候设置为 true
pub const STABLE: bool = true;
pub const STABLE: bool = false;
#[macro_export]
macro_rules! async_callback_with_state {

View File

@ -246,12 +246,23 @@ fn set_str_cfg_default_plugin(
// 给到 on config
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
if !attr.is_callable() {
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数不是 Callable", path, ON_CONFIG_FUNC_NAME);
event!(
Level::WARN,
"Python 插件 {:?} 的 {} 函数不是 Callable",
path,
ON_CONFIG_FUNC_NAME
);
return Ok(());
}
let args = (config_str.as_bytes(), );
let args = (config_str.as_bytes(),);
if let Err(e) = attr.call1(args) {
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数返回了一个报错 {}", path, ON_CONFIG_FUNC_NAME, e);
event!(
Level::WARN,
"Python 插件 {:?} 的 {} 函数返回了一个报错 {}",
path,
ON_CONFIG_FUNC_NAME,
e
);
}
}
@ -305,12 +316,23 @@ fn set_bytes_cfg_default_plugin(
// 给到 on config
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
if !attr.is_callable() {
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数不是 Callable", path, ON_CONFIG_FUNC_NAME);
event!(
Level::WARN,
"Python 插件 {:?} 的 {} 函数不是 Callable",
path,
ON_CONFIG_FUNC_NAME
);
return Ok(());
}
let args = (&config_vec, );
let args = (&config_vec,);
if let Err(e) = attr.call1(args) {
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数返回了一个报错 {}", path, ON_CONFIG_FUNC_NAME, e);
event!(
Level::WARN,
"Python 插件 {:?} 的 {} 函数返回了一个报错 {}",
path,
ON_CONFIG_FUNC_NAME,
e
);
}
}
Ok(())

1
ica-rs/src/wasms.rs Normal file
View File

@ -0,0 +1 @@