mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
Refine fastmcp-slim packaging (#4125)
* Refine fastmcp-slim packaging * Format install hints
This commit is contained in:
parent
bb4894d215
commit
ee48a0fd6e
13 changed files with 163 additions and 161 deletions
32
.github/workflows/run-tests.yml
vendored
32
.github/workflows/run-tests.yml
vendored
|
|
@ -145,7 +145,14 @@ jobs:
|
|||
import fastmcp
|
||||
import fastmcp.settings
|
||||
|
||||
assert not any(ep.name == "fastmcp" for ep in entry_points(group="console_scripts"))
|
||||
assert any(ep.name == "fastmcp" for ep in entry_points(group="console_scripts"))
|
||||
|
||||
try:
|
||||
from fastmcp.cli import app
|
||||
except ImportError as exc:
|
||||
assert "FastMCP CLI support is not installed" in str(exc)
|
||||
else:
|
||||
raise AssertionError(f"bare fastmcp-slim unexpectedly imported CLI app {app!r}")
|
||||
|
||||
try:
|
||||
fastmcp.FastMCP
|
||||
|
|
@ -167,7 +174,14 @@ jobs:
|
|||
from fastmcp.client.transports import StdioTransport, StreamableHttpTransport
|
||||
from fastmcp.mcp_config import MCPConfig
|
||||
|
||||
assert not any(ep.name == "fastmcp" for ep in entry_points(group="console_scripts"))
|
||||
assert any(ep.name == "fastmcp" for ep in entry_points(group="console_scripts"))
|
||||
|
||||
try:
|
||||
from fastmcp.cli import app
|
||||
except ImportError as exc:
|
||||
assert "FastMCP CLI support is not installed" in str(exc)
|
||||
else:
|
||||
raise AssertionError(f"client-only slim unexpectedly imported CLI app {app!r}")
|
||||
|
||||
assert Client("https://example.com/mcp")
|
||||
assert StreamableHttpTransport("https://example.com/mcp")
|
||||
|
|
@ -188,9 +202,18 @@ jobs:
|
|||
SLIM_WHEEL=$(ls /tmp/fastmcp-dist/fastmcp_slim-*.whl)
|
||||
uv pip install --python /tmp/fastmcp-slim-server-smoke/bin/python "${SLIM_WHEEL}[server]"
|
||||
/tmp/fastmcp-slim-server-smoke/bin/python - <<'PY'
|
||||
from importlib.metadata import entry_points
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.cli import app
|
||||
|
||||
assert any(
|
||||
ep.name == "fastmcp" and ep.value == "fastmcp.cli:app"
|
||||
for ep in entry_points(group="console_scripts")
|
||||
)
|
||||
|
||||
mcp = FastMCP("smoke")
|
||||
assert app is not None
|
||||
assert mcp.name == "smoke"
|
||||
PY
|
||||
|
||||
|
|
@ -201,11 +224,16 @@ jobs:
|
|||
uv pip install --python /tmp/fastmcp-full-smoke/bin/python --find-links /tmp/fastmcp-dist "$FULL_WHEEL"
|
||||
/tmp/fastmcp-full-smoke/bin/python - <<'PY'
|
||||
from importlib.metadata import entry_points
|
||||
from importlib.metadata import requires
|
||||
|
||||
from fastmcp import Client, FastMCP
|
||||
from fastmcp.client.client import CallToolResult
|
||||
from fastmcp.exceptions import ToolError
|
||||
|
||||
fastmcp_reqs = requires("fastmcp") or []
|
||||
assert any("fastmcp-slim[client,server]" in req for req in fastmcp_reqs)
|
||||
assert not any("fastmcp-slim[full" in req for req in fastmcp_reqs)
|
||||
|
||||
assert any(
|
||||
ep.name == "fastmcp" and ep.value == "fastmcp.cli:app"
|
||||
for ep in entry_points(group="console_scripts")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue