Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
167 lines (157 loc) · 6.03 KB
/
Copy pathtox.ini
File metadata and controls
167 lines (157 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
###############################################################################
# 📦 tox.ini - multi-interpreter test matrix powered by uv #
###############################################################################
#
# ➡ Why tox-uv?
# - one-shot lock-file-free dependency resolution (⚡ fast)
# - identical logic on macOS / Linux / Windows
# - ultra-small virtualenvs under ~/.cache/uv/venv
#
# ➡ Quickstart
# uv pip install tox tox-uv # install once
# tox -p auto # run whole matrix
#
# ➡ Environments
# py312 / py313 → doctest + unit tests (pytest)
#
###############################################################################
#############################
# Core tox configuration
#############################
[tox]
requires = tox>=4, tox-uv # 🔗 plugin discovery happens through this
envlist = py312, py313
skip_missing_interpreters = true # dev machines that miss 3.13-dev
# uv configuration for Python installation
uv_python_preference = only-managed # Only use uv-managed Python versions
#########################################
# GitHub-Actions / Azure DevOps mapping
#########################################
[gh-actions]
python =
3.12: py312
3.13: py313
#####################################################################
# 🔬 Default test environment #
# Every pyXY uses the same definition; only the interpreter differs. #
#####################################################################
[testenv] # <-- inherited by py312 / py313
runner = uv-venv-runner # tox-uv: create venv via 'uv venv'
package = uv-editable # install our package *editable* with 'uv pip'
extras = dev # pulls in pytest, coverage, bandit, mypy, ...
description = Run doctest and unit tests with {basepython}
commands =
python -m pytest --doctest-modules mcpgateway/ --tb=short -q
python -m pytest --maxfail=0 --disable-warnings -v --ignore=tests/fuzz --ignore=tests/playwright
# Python 3.13 specific environment - exclude packages that don't support 3.13 yet
[testenv:py313]
runner = uv-venv-runner
package = skip
deps =
# Install the package manually without dev extras
-e .
# Install core dependencies without problematic packages
aiohttp>=3.13.4
alembic>=1.16.5
argon2-cffi>=25.1.0
cookiecutter>=2.6.0
cryptography>=45.0.7
fastapi>=0.116.1
filelock>=3.19.1
gunicorn>=23.0.0
httpx>=0.28.1
httpx[http2]>=0.28.1
jinja2>=3.1.6
jq>=1.10.0
jsonpath-ng>=1.7.0
jsonschema>=4.25.1
mcp>=1.13.1
oauthlib>=3.3.1
parse>=1.20.2
psutil>=7.0.0
pydantic>=2.11.7
pydantic[email]>=2.11.7
pydantic-settings>=2.10.1
pyjwt>=2.10.1
python-json-logger>=3.3.0
PyYAML>=6.0.2
requests-oauthlib>=2.0.0
sqlalchemy>=2.0.43
sse-starlette>=3.0.2
starlette>=0.47.3
typer>=0.17.4
uvicorn>=0.35.0
# Test dependencies
pytest>=8.4.2
pytest-asyncio>=1.1.0
pytest-cov>=6.2.1
pytest-env>=1.1.5
coverage>=7.10.6
chuk-mcp-runtime>=0.6.5
# Skip pytype, libcst and other packages that don't support Python 3.13 yet
description = Run doctest and unit tests with Python 3.13 (excluding unsupported packages)
commands =
python -m pytest --doctest-modules mcpgateway/ --tb=short -q
python -m pytest --maxfail=0 --disable-warnings -v --ignore=tests/fuzz --ignore=tests/playwright
passenv =
DATABASE_URL
MCPGATEWAY_* # <-- commonly used by this repo's tests
AUTH_* #
CACHE_* #
setenv =
PYTHONWARNINGS = ignore::DeprecationWarning
##########################
# 🧹 Code style & lint
##########################
# `ruff`, `black`, and `isort` are invoked via `uv tool run <tool>==<pin>` so
# tox, CI (.github/workflows/lint.yml), and the Makefile all use identical
# versions. Keep these pins in lockstep with the *_VERSION variables in the
# Makefile and the env: block in .github/workflows/lint.yml.
[testenv:lint]
runner = uv-venv-runner
skip_install = true # linting doesn't need our package importable
extras = dev
allowlist_externals = uv
description = Static-analysis (ruff + black -check + isort -check + bandit)
setenv =
RUFF_VERSION = 0.15.1
BLACK_VERSION = 26.3.1
ISORT_VERSION = 6.1.0
commands =
uv tool run ruff=={env:RUFF_VERSION} check .
uv tool run black=={env:BLACK_VERSION} --check .
uv tool run isort=={env:ISORT_VERSION} --check-only .
bandit -r mcpgateway -n 5
pre-commit run --all-files --show-diff-on-failure
###################################
# 🔍 Strict static type checking
###################################
[testenv:type]
runner = uv-venv-runner
skip_install = true
extras = dev
description = Mypy strict type-checking
commands =
mypy mcpgateway tests --install-types --non-interactive
################################
# 📦 Build sdist + universal wheel
################################
[testenv:pkg]
runner = uv-venv-runner
skip_install = true
deps = build # minimal requirement for PEP 517 build
description = Build wheel + sdist via uv
commands =
python3 -m build --sdist --wheel --outdir {toxworkdir}/dist
###############################################################################
# ☑︎ Advanced uv knobs (optional - uncomment if you need them)
###############################################################################
# [testenv]
# uv_seed = true # ⤷ inject pip/setuptools/wheel (legacy builds)
# uv_resolution = lowest # ⤷ lowest, lowest-direct, highest (default)
# system_site_packages = false # ⤷ give env access to global site-pkgs
#
# [testenv:lock-example]
# runner = uv-venv-lock-runner # use uv.lock + uv sync
# extras = dev # install [dev] extras listed in uv.lock
###############################################################################