mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 05:24:18 +02:00
fix fastmcp version ,python path valueError
run fastmcp version , when codes in other volume ``` ValueError: '/Volumes/Codes/../.venv/lib/python3.13' is not in the subpath of '/Users/<user home>' ```
This commit is contained in:
parent
0c15d60696
commit
296f1c312e
1 changed files with 5 additions and 1 deletions
|
|
@ -180,13 +180,17 @@ def _import_server(file: Path, server_object: str | None = None):
|
|||
def version(ctx: Context):
|
||||
if ctx.resilient_parsing:
|
||||
return
|
||||
try:
|
||||
fastmcp_path = f"~/{Path(__file__).resolve().parents[3].relative_to(Path.home())}"
|
||||
except ValueError:
|
||||
fastmcp_path = str(Path(__file__).resolve().parents[3])
|
||||
|
||||
info = {
|
||||
"FastMCP version": fastmcp.__version__,
|
||||
"MCP version": importlib.metadata.version("mcp"),
|
||||
"Python version": platform.python_version(),
|
||||
"Platform": platform.platform(),
|
||||
"FastMCP root path": f"~/{Path(__file__).resolve().parents[3].relative_to(Path.home())}",
|
||||
"FastMCP root path": fastmcp_path,
|
||||
}
|
||||
|
||||
g = Table.grid(padding=(0, 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue