[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "drissionpage-mcp-modified"
version = "1.0.0"
description = "DrissionPageMCPServer_Modified - 基于DrissionPage-MCP-Server二次开发的MCP服务"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{name = "cfx_software", email = "cfx_software@163.com"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP :: Browsers",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing"
]
keywords = ["drissionpage", "mcp", "browser", "automation", "web-scraping", "testing"]
license = {text = "MIT"}
dependencies = [
"DrissionPage>=4.0.0",
"fastmcp>=0.2.0",
"mcp>=1.0.0",
"typing-extensions>=4.0.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"isort>=5.12.0",
"flake8>=6.0.0",
"mypy>=1.0.0",
"pre-commit>=3.0.0"
]
docs = [
"sphinx>=6.0.0",
"sphinx-rtd-theme>=1.2.0",
"myst-parser>=1.0.0"
]
test = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.0.0",
"pytest-mock>=3.10.0",
"httpx>=0.24.0"
]
[[tool.uv.index]]
url = "https://pypi.org/simple"
default = true
[project.urls]
"Original Project" = "https://github.com/persist-1/DrissionPage-MCP-Server"
[project.scripts]
drissionpage-mcp = "drissionpage_mcp.main:main"
dp-mcp = "drissionpage_mcp.main:main"
[project.entry-points."mcp.servers"]
drissionpage = "drissionpage_mcp.main:DrissionPageMCP"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
include = ["drissionpage_mcp*"]
exclude = ["tests*"]
[tool.setuptools.package-data]
drissionpage_mcp = [
"config/*.json",
"config/*.yaml",
"templates/*.html",
"static/*"
]
# 代码格式化配置
[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
)
'''
# 导入排序配置
[tool.isort]
profile = "black"
line_length = 100
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
# 类型检查配置
[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
[[tool.mypy.overrides]]
module = [
"DrissionPage.*",
"fastmcp.*",
"mcp.*"
]
ignore_missing_imports = true
# 测试配置
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers --strict-config"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m 'not slow'')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"browser: marks tests that require browser",
"network: marks tests that require network access"
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning"
]
# 测试覆盖率配置
[tool.coverage.run]
source = ["src/drissionpage_mcp"]
omit = [
"*/tests/*",
"*/test_*",
"*/__pycache__/*",
"*/.*"
]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod"
]
ignore_errors = true
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "htmlcov"
# Flake8配置(通过setup.cfg或.flake8文件)
[tool.flake8]
max-line-length = 100
extend-ignore = ["E203", "W503"]
exclude = [
".git",
"__pycache__",
"build",
"dist",
".eggs",
"*.egg-info",
".venv",
".tox"
]
per-file-ignores = [
"__init__.py:F401",
"tests/*:S101"
]
# 安全检查配置
[tool.bandit]
exclude_dirs = ["tests", "build", "dist"]
skips = ["B101", "B601"]
# 依赖检查配置
[tool.safety]
full_report = true
ignore = []
# 文档配置
[tool.sphinx]
source-dir = "docs"
build-dir = "docs/_build"
all_files = 1
# 预提交钩子配置
[[tool.pre-commit.repos]]
repo = "https://github.com/psf/black"
rev = "23.3.0"
hooks = [{id = "black"}]
[[tool.pre-commit.repos]]
repo = "https://github.com/pycqa/isort"
rev = "5.12.0"
hooks = [{id = "isort"}]
[[tool.pre-commit.repos]]
repo = "https://github.com/pycqa/flake8"
rev = "6.0.0"
hooks = [{id = "flake8"}]
[[tool.pre-commit.repos]]
repo = "https://github.com/pre-commit/mirrors-mypy"
rev = "v1.3.0"
hooks = [{id = "mypy", additional_dependencies = ["types-all"]}]