mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
chore: upgrade jupyter runtimelib to 0.11.0 (#24036)
Brings in: * More fully typed structures (for when we get to implementing more) * `with_metadata`, `with_buffers`, etc. from https://github.com/runtimed/runtimed/pull/99 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
3d3722507e
commit
cf611fbf54
6 changed files with 28 additions and 32 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -5356,9 +5356,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "runtimelib"
|
name = "runtimelib"
|
||||||
version = "0.9.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4300b46ab6f2970f81c176f4f2f7ff0a48809f52be7a8fd4ca5a32e9002f6e8f"
|
checksum = "81f4969d577fe13ef40c8eb6fad2ccc66c26c800410672c847f5397699240b9d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
|
|
|
@ -111,6 +111,7 @@ ignore = "0.4"
|
||||||
import_map = { version = "=0.19.0", features = ["ext"] }
|
import_map = { version = "=0.19.0", features = ["ext"] }
|
||||||
indexmap.workspace = true
|
indexmap.workspace = true
|
||||||
jsonc-parser.workspace = true
|
jsonc-parser.workspace = true
|
||||||
|
jupyter_runtime = { package = "runtimelib", version = "=0.11.0" }
|
||||||
lazy-regex.workspace = true
|
lazy-regex.workspace = true
|
||||||
libc.workspace = true
|
libc.workspace = true
|
||||||
libz-sys.workspace = true
|
libz-sys.workspace = true
|
||||||
|
@ -130,7 +131,6 @@ rand = { workspace = true, features = ["small_rng"] }
|
||||||
regex.workspace = true
|
regex.workspace = true
|
||||||
reqwest.workspace = true
|
reqwest.workspace = true
|
||||||
ring.workspace = true
|
ring.workspace = true
|
||||||
runtimelib = "=0.9.0"
|
|
||||||
rustyline.workspace = true
|
rustyline.workspace = true
|
||||||
rustyline-derive = "=0.7.0"
|
rustyline-derive = "=0.7.0"
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
|
|
@ -4,10 +4,10 @@ use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use runtimelib::JupyterMessage;
|
use jupyter_runtime::JupyterMessage;
|
||||||
use runtimelib::JupyterMessageContent;
|
use jupyter_runtime::JupyterMessageContent;
|
||||||
use runtimelib::KernelIoPubConnection;
|
use jupyter_runtime::KernelIoPubConnection;
|
||||||
use runtimelib::StreamContent;
|
use jupyter_runtime::StreamContent;
|
||||||
|
|
||||||
use deno_core::error::AnyError;
|
use deno_core::error::AnyError;
|
||||||
use deno_core::op2;
|
use deno_core::op2;
|
||||||
|
@ -65,12 +65,9 @@ pub async fn op_jupyter_broadcast(
|
||||||
err
|
err
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let mut jupyter_message = JupyterMessage::new(content, Some(&last_request));
|
let jupyter_message = JupyterMessage::new(content, Some(&last_request))
|
||||||
|
.with_metadata(metadata)
|
||||||
jupyter_message.metadata = metadata;
|
.with_buffers(buffers.into_iter().map(|b| b.to_vec().into()).collect());
|
||||||
jupyter_message.buffers =
|
|
||||||
buffers.into_iter().map(|b| b.to_vec().into()).collect();
|
|
||||||
jupyter_message.set_parent(last_request);
|
|
||||||
|
|
||||||
(iopub_connection.lock().await)
|
(iopub_connection.lock().await)
|
||||||
.send(jupyter_message)
|
.send(jupyter_message)
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::env::current_exe;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use runtimelib::dirs::user_data_dir;
|
use jupyter_runtime::dirs::user_data_dir;
|
||||||
|
|
||||||
const DENO_ICON_32: &[u8] = include_bytes!("./resources/deno-logo-32x32.png");
|
const DENO_ICON_32: &[u8] = include_bytes!("./resources/deno-logo-32x32.png");
|
||||||
const DENO_ICON_64: &[u8] = include_bytes!("./resources/deno-logo-64x64.png");
|
const DENO_ICON_64: &[u8] = include_bytes!("./resources/deno-logo-64x64.png");
|
||||||
|
|
|
@ -23,8 +23,8 @@ use deno_runtime::permissions::PermissionsContainer;
|
||||||
use deno_runtime::WorkerExecutionMode;
|
use deno_runtime::WorkerExecutionMode;
|
||||||
use deno_terminal::colors;
|
use deno_terminal::colors;
|
||||||
|
|
||||||
use runtimelib::jupyter::ConnectionInfo;
|
use jupyter_runtime::jupyter::ConnectionInfo;
|
||||||
use runtimelib::messaging::StreamContent;
|
use jupyter_runtime::messaging::StreamContent;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use tokio::sync::mpsc::UnboundedSender;
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
|
|
||||||
|
|
|
@ -19,19 +19,18 @@ use deno_core::CancelHandle;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
use runtimelib::ConnectionInfo;
|
use jupyter_runtime::messaging;
|
||||||
use runtimelib::KernelControlConnection;
|
use jupyter_runtime::AsChildOf;
|
||||||
use runtimelib::KernelHeartbeatConnection;
|
use jupyter_runtime::ConnectionInfo;
|
||||||
use runtimelib::KernelIoPubConnection;
|
use jupyter_runtime::JupyterMessage;
|
||||||
use runtimelib::KernelShellConnection;
|
use jupyter_runtime::JupyterMessageContent;
|
||||||
|
use jupyter_runtime::KernelControlConnection;
|
||||||
use runtimelib::messaging;
|
use jupyter_runtime::KernelHeartbeatConnection;
|
||||||
use runtimelib::AsChildOf;
|
use jupyter_runtime::KernelIoPubConnection;
|
||||||
use runtimelib::JupyterMessage;
|
use jupyter_runtime::KernelShellConnection;
|
||||||
use runtimelib::JupyterMessageContent;
|
use jupyter_runtime::ReplyError;
|
||||||
use runtimelib::ReplyError;
|
use jupyter_runtime::ReplyStatus;
|
||||||
use runtimelib::ReplyStatus;
|
use jupyter_runtime::StreamContent;
|
||||||
use runtimelib::StreamContent;
|
|
||||||
|
|
||||||
pub struct JupyterServer {
|
pub struct JupyterServer {
|
||||||
execution_count: usize,
|
execution_count: usize,
|
||||||
|
@ -455,7 +454,7 @@ impl JupyterServer {
|
||||||
messaging::ExecuteReply {
|
messaging::ExecuteReply {
|
||||||
execution_count: self.execution_count,
|
execution_count: self.execution_count,
|
||||||
status: ReplyStatus::Error,
|
status: ReplyStatus::Error,
|
||||||
payload: None,
|
payload: Default::default(),
|
||||||
user_expressions: None,
|
user_expressions: None,
|
||||||
error: None,
|
error: None,
|
||||||
}
|
}
|
||||||
|
@ -481,7 +480,7 @@ impl JupyterServer {
|
||||||
execution_count: self.execution_count,
|
execution_count: self.execution_count,
|
||||||
status: ReplyStatus::Ok,
|
status: ReplyStatus::Ok,
|
||||||
user_expressions: None,
|
user_expressions: None,
|
||||||
payload: None,
|
payload: Default::default(),
|
||||||
error: None,
|
error: None,
|
||||||
}
|
}
|
||||||
.as_child_of(parent_message),
|
.as_child_of(parent_message),
|
||||||
|
@ -586,7 +585,7 @@ impl JupyterServer {
|
||||||
traceback,
|
traceback,
|
||||||
}),
|
}),
|
||||||
user_expressions: None,
|
user_expressions: None,
|
||||||
payload: None,
|
payload: Default::default(),
|
||||||
}
|
}
|
||||||
.as_child_of(parent_message),
|
.as_child_of(parent_message),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue