[tox]
envlist = py{39,310,311,312}, lint, docs, coverage
isolated_build = True
[testenv]
deps =
-r{toxinidir}/requirements.txt
commands =
pytest {posargs:tests -v}
[testenv:lint]
deps =
black
isort
flake8
mypy
pylint
pydocstyle
commands =
black --check mcp_server tests
isort --check-only mcp_server tests
flake8 mcp_server tests
mypy mcp_server
pylint mcp_server
pydocstyle mcp_server
[testenv:format]
deps =
black
isort
commands =
black mcp_server tests
isort mcp_server tests
[testenv:coverage]
deps =
-r{toxinidir}/requirements.txt
coverage[toml]
commands =
coverage erase
coverage run -m pytest tests
coverage report
coverage html
coverage xml
[testenv:docs]
deps =
sphinx
sphinx-rtd-theme
myst-parser
changedir = docs
commands =
sphinx-build -b html . _build/html
[testenv:security]
deps =
safety
bandit
commands =
safety check
bandit -r mcp_server
[testenv:benchmark]
deps =
-r{toxinidir}/requirements.txt
commands =
pytest tests -v -m benchmark --benchmark-only
[flake8]
max-line-length = 88
extend-ignore = E203, W503
exclude = .git,__pycache__,docs,build,dist,.tox,venv
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
[mypy]
python_version = 3.11
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_no_return = True
warn_unreachable = True
strict_equality = True