mcp-feedback-enhanced/pyproject.toml
2025-06-11 03:15:24 +08:00

262 lines
6.6 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[project]
name = "mcp-feedback-enhanced"
version = "2.3.0"
description = "Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring Web UI with intelligent environment detection and optional Electron desktop application."
readme = "README.md"
requires-python = ">=3.11"
authors = [
{ name = "Minidoracat", email = "minidora0702@gmail.com" }
]
keywords = ["mcp", "ai", "feedback", "web-ui", "interactive", "development", "electron", "desktop", "cross-platform"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: User Interfaces",
]
dependencies = [
"fastmcp>=2.0.0",
"psutil>=7.0.0",
"fastapi>=0.115.0",
"uvicorn>=0.30.0",
"jinja2>=3.1.0",
"websockets>=13.0.0",
"aiohttp>=3.8.0",
"mcp>=1.9.3",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
]
desktop = [
# Node.js 環境需要系統安裝,不是 Python 套件
# 請確保系統已安裝 Node.js >= 16.0.0
]
[project.urls]
Homepage = "https://github.com/Minidoracat/mcp-feedback-enhanced"
Repository = "https://github.com/Minidoracat/mcp-feedback-enhanced"
Issues = "https://github.com/Minidoracat/mcp-feedback-enhanced/issues"
[project.scripts]
mcp-feedback-enhanced = "mcp_feedback_enhanced.__main__:main"
interactive-feedback-mcp = "mcp_feedback_enhanced.__main__:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/mcp_feedback_enhanced"]
[tool.uv]
dev-dependencies = [
"bump2version>=1.0.1",
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-timeout>=2.1.0",
"twine>=6.1.0",
"ruff>=0.11.0",
"mypy>=1.16.0",
"pre-commit>=4.0.0",
]
# ===== Ruff 配置 =====
[tool.ruff]
# 目標 Python 版本
target-version = "py311"
# 程式碼行長度
line-length = 88
# 包含的檔案模式
include = ["*.py", "*.pyi", "**/pyproject.toml"]
# 排除的檔案和目錄
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"*.egg-info",
".trunk",
]
[tool.ruff.lint]
# 啟用的規則集
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"C90", # mccabe
"T20", # flake8-print
"TID", # flake8-tidy-imports
"ICN", # flake8-import-conventions
"RET", # flake8-return
"SIM", # flake8-simplify
"S", # bandit (安全檢查)
"A", # flake8-builtins
"COM", # flake8-commas
"PL", # Pylint
"RUF", # Ruff-specific rules
]
# 忽略的規則
ignore = [
"E501", # 行長度由 formatter 處理
"S101", # 允許使用 assert
"S603", # 允許 subprocess 調用
"S607", # 允許部分路徑執行
"PLR0913", # 允許多參數函數
"PLR0912", # 允許多分支
"PLR0911", # 允許多返回語句
"PLR2004", # 允許魔術數字
"COM812", # 避免與 formatter 衝突
"COM819", # 避免與 formatter 衝突
"T201", # 允許 print 語句(調試用)
"RUF001", # 允許全角字符(中文項目)
"RUF002", # 允許全角字符(中文項目)
"RUF003", # 允許全角字符(中文項目)
"C901", # 允許複雜函數(暫時)
"TID252", # 允許相對導入(暫時)
"E402", # 允許模組級導入不在頂部(暫時)
"F841", # 允許未使用變數(暫時)
"B007", # 允許未使用循環變數(暫時)
"SIM105", # 允許 try-except-pass暫時
"SIM102", # 允許嵌套 if暫時
"SIM103", # 允許複雜條件(暫時)
"SIM117", # 允許嵌套 with暫時
"RET504", # 允許不必要賦值(暫時)
"RUF005", # 允許列表連接(暫時)
"S108", # 允許臨時文件路徑(暫時)
"S110", # 允許 try-except-pass暫時
"E712", # 允許布林比較(暫時)
"E722", # 允許裸露 except暫時
]
# 每個檔案的最大複雜度
mccabe.max-complexity = 10
[tool.ruff.lint.per-file-ignores]
# 測試檔案的特殊規則
"tests/**/*.py" = [
"S101", # 測試中允許 assert
"ARG", # 測試中允許未使用參數
"FBT", # 測試中允許布林參數
"PLR2004", # 測試中允許魔術數字
"S311", # 測試中允許偽隨機生成器
]
# __init__.py 檔案的特殊規則
"__init__.py" = [
"F401", # 允許未使用的導入
]
# 腳本檔案的特殊規則
"scripts/**/*.py" = [
"T201", # 腳本中允許 print
"S602", # 腳本中允許 shell 調用
]
[tool.ruff.format]
# 使用雙引號
quote-style = "double"
# 縮排樣式
indent-style = "space"
# 跳過魔術逗號
skip-magic-trailing-comma = false
# 行結尾
line-ending = "auto"
[tool.ruff.lint.isort]
# import 排序配置
known-first-party = ["mcp_feedback_enhanced"]
force-single-line = false
lines-after-imports = 2
# ===== mypy 配置 =====
[tool.mypy]
# Python 版本
python_version = "3.11"
# 基本設定
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false # 漸進式啟用
disallow_incomplete_defs = false # 漸進式啟用
check_untyped_defs = true
disallow_untyped_decorators = false # 漸進式啟用
# 嚴格模式(漸進式啟用)
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
# 錯誤格式
show_error_codes = true
show_column_numbers = true
pretty = true
# 包含和排除
files = ["src", "tests"]
exclude = [
"build/",
"dist/",
".venv/",
"venv/",
".trunk/",
"node_modules/",
]
# 第三方庫配置
[[tool.mypy.overrides]]
module = [
"fastmcp.*",
"mcp.*",
"psutil.*",
"uvicorn.*",
"websockets.*",
"aiohttp.*",
]
ignore_missing_imports = true
# 測試檔案的寬鬆配置
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false