pyproject.toml•3.17 kB
[project]
name = "fastapi-openapi-mcp"
version = "0.1.0"
description = "将 FastAPI 应用的 OpenAPI 文档转换为 MCP Tools,让 AI 编程助手能够高效查询 API 信息"
authors = [
{ name = "Jason Chang", email = "choayue.chang@gmail.com" }
]
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.13"
keywords = ["fastapi", "openapi", "mcp", "ai", "model-context-protocol"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Framework :: FastAPI",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"fastapi>=0.115.0",
"mcp>=1.0.0",
"pydantic>=2.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"pytest-mock>=3.14.0",
"ruff>=0.8.0",
"basedpyright>=1.21.0",
"httpx>=0.28.0", # 用于测试
]
[project.urls]
Homepage = "https://github.com/yourusername/openapi-mcp-server"
Documentation = "https://github.com/yourusername/openapi-mcp-server#readme"
Repository = "https://github.com/yourusername/openapi-mcp-server"
Issues = "https://github.com/yourusername/openapi-mcp-server/issues"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["openapi_mcp"]
# ===== Ruff 配置 =====
[tool.ruff]
target-version = "py313"
line-length = 88
indent-width = 4
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG001", # unused arguments
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"W191", # tab indentation (handled by formatter)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ARG001"] # Ignore unused arguments in test files (fixtures may not be directly used)
[tool.ruff.format]
quote-style = "single"
indent-style = "tab"
# ===== Basedpyright 配置 =====
[tool.basedpyright]
pythonVersion = "3.13"
include = ["openapi_mcp", "tests"]
exclude = [
"**/__pycache__",
"**/node_modules",
".venv",
"build",
"dist",
]
typeCheckingMode = "standard"
reportMissingImports = true
reportMissingTypeStubs = false
# ===== Pytest 配置 =====
[tool.pytest.ini_options]
minversion = "8.0"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-v",
"--strict-markers",
"--tb=short",
"--cov=openapi_mcp",
"--cov-report=term-missing",
"--cov-report=html",
]
# ===== Coverage 配置 =====
[tool.coverage.run]
source = ["openapi_mcp"]
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/site-packages/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]