chore: cov settings, and fix serveral building warnings (#281)
* chore: cov settings, update Python test dependencies and adjust command arguments * fix: remove .vscode dir
This commit is contained in:
parent
8e1490bcd8
commit
55215b6170
6 changed files with 40 additions and 10 deletions
|
|
@ -134,7 +134,8 @@ impl<R: SseStreamReconnect> SseAutoReconnectStream<R> {
|
|||
}
|
||||
|
||||
impl<E: std::error::Error + Send> SseAutoReconnectStream<NeverReconnect<E>> {
|
||||
pub fn never_reconnect(stream: BoxedSseResponse, error_when_reconnect: E) -> Self {
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn never_reconnect(stream: BoxedSseResponse, error_when_reconnect: E) -> Self {
|
||||
Self {
|
||||
retry_policy: Arc::new(NeverRetry),
|
||||
last_event_id: None,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(dead_code)]
|
||||
use std::{convert::Infallible, fmt::Display, sync::Arc, time::Duration};
|
||||
|
||||
use bytes::{Buf, Bytes};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ async fn init() -> anyhow::Result<()> {
|
|||
.with(tracing_subscriber::fmt::layer())
|
||||
.try_init();
|
||||
tokio::process::Command::new("uv")
|
||||
.args(["pip", "install", "-r", "pyproject.toml"])
|
||||
.args(["sync"])
|
||||
.current_dir("tests/test_with_python")
|
||||
.spawn()?
|
||||
.wait()
|
||||
|
|
@ -38,8 +38,9 @@ async fn test_with_python_client() -> anyhow::Result<()> {
|
|||
|
||||
let status = tokio::process::Command::new("uv")
|
||||
.arg("run")
|
||||
.arg("tests/test_with_python/client.py")
|
||||
.arg("client.py")
|
||||
.arg(format!("http://{BIND_ADDRESS}/sse"))
|
||||
.current_dir("tests/test_with_python")
|
||||
.spawn()?
|
||||
.wait()
|
||||
.await?;
|
||||
|
|
@ -88,8 +89,9 @@ async fn test_nested_with_python_client() -> anyhow::Result<()> {
|
|||
tokio::time::Duration::from_secs(5),
|
||||
tokio::process::Command::new("uv")
|
||||
.arg("run")
|
||||
.arg("tests/test_with_python/client.py")
|
||||
.arg("client.py")
|
||||
.arg(format!("http://{BIND_ADDRESS}/nested/sse"))
|
||||
.current_dir("tests/test_with_python")
|
||||
.spawn()?
|
||||
.wait(),
|
||||
)
|
||||
|
|
@ -104,7 +106,9 @@ async fn test_with_python_server() -> anyhow::Result<()> {
|
|||
init().await?;
|
||||
|
||||
let transport = TokioChildProcess::new(tokio::process::Command::new("uv").configure(|cmd| {
|
||||
cmd.arg("run").arg("tests/test_with_python/server.py");
|
||||
cmd.arg("run")
|
||||
.arg("server.py")
|
||||
.current_dir("tests/test_with_python");
|
||||
}))?;
|
||||
|
||||
let client = ().serve(transport).await?;
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
*.lock
|
||||
|
|
@ -7,8 +7,8 @@ name = "test_with_python"
|
|||
version = "0.1.0"
|
||||
description = "Test Python client for RMCP"
|
||||
dependencies = [
|
||||
"mcp",
|
||||
"fastmcp",
|
||||
]
|
||||
|
||||
[tool.setuptools]
|
||||
py-modules = ["client", "server"]
|
||||
py-modules = ["client", "server"]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from mcp.server.fastmcp import FastMCP
|
||||
from fastmcp import FastMCP
|
||||
|
||||
mcp = FastMCP("Demo")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue