Files
DeepTutor/packaging/deeptutor-cli/pyproject.toml
Souptik Chakraborty 1091a88fc4 fix: Install mcp by default so pageindex MCP connects (#852)
The `mcp` client was declared only under the `partners` extra, but the MCP
connection manager and the built-in PageIndex MCP server are core: the manager
overlays a reserved `pageindex` entry onto the config whenever a PageIndex API
key is set, on any turn. A plain `pip install deeptutor` therefore had no `mcp`,
so the connection task raised ModuleNotFoundError, never resolved the caller's
ready future, and every turn stalled for the full 15s connect timeout before
reporting the one cause that was not responsible: "connect timed out after 15s".

Declare `mcp>=1.26.0,<2.0.0` as a core dependency of both published
distributions and drop it from the `partners` extra, which now inherits it.
Mirror the move in requirements/ (cli.txt gains it, partners.txt inherits it
via server.txt).

Also import `mcp` inside `_run_server`'s guarded block rather than above it. At
function scope the import raised before anything could fail `ready`, which is
what turned a permanent, instantly-knowable error into a timeout plus an
orphaned "Task exception was never retrieved". Inside the block the real cause
reaches the caller immediately.

Closes #792
2026-08-16 19:07:59 +08:00

84 lines
2.4 KiB
TOML

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "deeptutor-cli"
dynamic = ["version"]
description = "CLI-only distribution for DeepTutor"
# Capped below 3.14 to match the main `deeptutor` package (issue #664): 3.14
# lacks wheels for some compiled base deps (e.g. faiss-cpu), so pip falls back
# to a source build that fails. Refuse 3.14 cleanly instead.
requires-python = ">=3.11,<3.14"
readme = "README.md"
license = {text = "Apache-2.0"}
dependencies = [
"PyYAML>=6.0",
"jinja2>=3.1.0",
"openai>=1.30.0",
"tiktoken>=0.5.0",
"aiohttp>=3.9.4",
"httpx>=0.27.0",
"requests>=2.32.2",
"ddgs>=9.9.1",
"nest_asyncio>=1.5.8",
"tenacity>=8.0.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"aiosqlite>=0.19.0",
"typer>=0.9.0",
"rich>=13.0.0",
"prompt_toolkit>=3.0.36",
# MCP client. This distribution ships `deeptutor.services.mcp`, including the
# built-in PageIndex MCP server that is injected whenever a PageIndex API key
# is configured, so it needs the client too (issue #792).
"mcp>=1.26.0,<2.0.0",
"anthropic>=0.30.0",
"dashscope>=1.14.0",
"perplexityai>=0.1.0",
"oauth-cli-kit>=0.1.1",
"llama-index>=0.14.12",
"llama-index-retrievers-bm25>=0.7.1,<0.8.0",
# FAISS vector store: ANN retrieval replacing SimpleVectorStore brute force for
# large KBs (issue #552); imported lazily with SimpleVectorStore fallback.
"llama-index-vector-stores-faiss>=0.4.0,<1.0.0",
"faiss-cpu>=1.8.0,<2.0.0",
"PyMuPDF>=1.26.0",
"numpy>=1.24.0,<3.0.0",
"arxiv>=2.0.0",
"python-docx>=1.1.0",
"openpyxl>=3.1.0",
"python-pptx>=1.0.0",
"pypdf>=4.0.0",
"defusedxml>=0.7.1",
]
[project.scripts]
deeptutor = "deeptutor_cli.main:main"
[tool.setuptools]
package-dir = {"" = "../.."}
include-package-data = false
[tool.setuptools.dynamic]
version = {attr = "deeptutor.__version__.__version__"}
[tool.setuptools.packages.find]
where = ["../.."]
include = ["deeptutor*", "deeptutor_cli*"]
exclude = ["deeptutor_web*"]
# This distribution includes the shared agent implementations. Keep their
# runtime prompt/config assets in the wheel as the full distribution does.
[tool.setuptools.package-data]
deeptutor = [
"**/*.yaml",
"**/*.yml",
"**/*.md",
"**/*.json",
"**/*.sh",
"**/*.j2",
"**/*.jinja",
]
deeptutor_cli = ["**/*.md"]