chore: bump ruff (#1085)
This commit is contained in:
parent
6f43d1f170
commit
9301924f44
1 changed files with 56 additions and 57 deletions
|
|
@ -150,10 +150,10 @@ def _import_server(file: Path, server_object: str | None = None):
|
|||
True if it's supported.
|
||||
"""
|
||||
if not isinstance(server_object, FastMCP):
|
||||
logger.error(f"The server object {object_name} is of type " f"{type(server_object)} (expecting {FastMCP}).")
|
||||
logger.error(f"The server object {object_name} is of type {type(server_object)} (expecting {FastMCP}).")
|
||||
if isinstance(server_object, LowLevelServer):
|
||||
logger.warning(
|
||||
"Note that only FastMCP server is supported. Low level " "Server class is not yet supported."
|
||||
"Note that only FastMCP server is supported. Low level Server class is not yet supported."
|
||||
)
|
||||
return False
|
||||
return True
|
||||
|
|
@ -164,7 +164,7 @@ def _import_server(file: Path, server_object: str | None = None):
|
|||
for name in ["mcp", "server", "app"]:
|
||||
if hasattr(module, name):
|
||||
if not _check_server_object(getattr(module, name), f"{file}:{name}"):
|
||||
logger.error(f"Ignoring object '{file}:{name}' as it's not a valid " "server object")
|
||||
logger.error(f"Ignoring object '{file}:{name}' as it's not a valid server object")
|
||||
continue
|
||||
return getattr(module, name)
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ def dev(
|
|||
npx_cmd = _get_npx_command()
|
||||
if not npx_cmd:
|
||||
logger.error(
|
||||
"npx not found. Please ensure Node.js and npm are properly installed " "and added to your system PATH."
|
||||
"npx not found. Please ensure Node.js and npm are properly installed and added to your system PATH."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
|
@ -371,7 +371,7 @@ def install(
|
|||
typer.Option(
|
||||
"--name",
|
||||
"-n",
|
||||
help="Custom name for the server (defaults to server's name attribute or" " file name)",
|
||||
help="Custom name for the server (defaults to server's name attribute or file name)",
|
||||
),
|
||||
] = None,
|
||||
with_editable: Annotated[
|
||||
|
|
@ -445,7 +445,7 @@ def install(
|
|||
name = server.name
|
||||
except (ImportError, ModuleNotFoundError) as e:
|
||||
logger.debug(
|
||||
"Could not import server (likely missing dependencies), using file" " name",
|
||||
"Could not import server (likely missing dependencies), using file name",
|
||||
extra={"error": str(e)},
|
||||
)
|
||||
name = file.stem
|
||||
|
|
|
|||
Loading…
Reference in a new issue