Skip to content

Commit b532c58

Browse files
committed
feat: Add tox configuration for OpenStack standard testing
Add tox.ini following OpenStack project standards to support: - Multiple Python versions testing (py3, py310-313) - Style checking with ruff (pep8 environment) - Code formatting (format environment) - Coverage reporting (cover environment) - Debug support (debug environment) - Virtual environment for arbitrary commands (venv environment) This allows OpenStack contributors to use familiar tox commands while maintaining uv for fast local development.
1 parent abaa4eb commit b532c58

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

tox.ini

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[tox]
2+
minversion = 4.3.0
3+
envlist = py3,py{310,311,312,313},pep8
4+
skipsdist = False
5+
6+
[testenv]
7+
usedevelop = True
8+
setenv =
9+
VIRTUAL_ENV={envdir}
10+
OS_STDOUT_CAPTURE=1
11+
OS_STDERR_CAPTURE=1
12+
OS_TEST_TIMEOUT=60
13+
deps =
14+
-r{toxinidir}/requirements.txt
15+
pytest>=8.4.1
16+
commands =
17+
pytest {posargs}
18+
19+
[testenv:pep8]
20+
description = Run style checks with ruff
21+
deps =
22+
ruff>=0.12.5
23+
commands =
24+
ruff check src tests
25+
ruff format --check src tests
26+
27+
[testenv:format]
28+
description = Auto-format code with ruff
29+
deps =
30+
ruff>=0.12.5
31+
commands =
32+
ruff check --fix src tests
33+
ruff format src tests
34+
35+
[testenv:venv]
36+
description = Run arbitrary commands in a virtual environment
37+
commands = {posargs}
38+
39+
[testenv:cover]
40+
description = Generate test coverage report
41+
deps =
42+
{[testenv]deps}
43+
coverage>=7.0
44+
pytest-cov>=6.0.0
45+
commands =
46+
pytest --cov=openstack_mcp_server --cov-report=html:cover --cov-report=xml:cover/coverage.xml --cov-report=term {posargs}
47+
48+
[testenv:debug]
49+
description = Run tests with debugging
50+
commands =
51+
pytest --pdb {posargs}
52+
53+
[testenv:docs]
54+
description = Build documentation (placeholder for future use)
55+
allowlist_externals = echo
56+
commands =
57+
echo "Documentation building not yet configured"
58+
59+
[testenv:py310]
60+
basepython = python3.10
61+
62+
[testenv:py311]
63+
basepython = python3.11
64+
65+
[testenv:py312]
66+
basepython = python3.12
67+
68+
[testenv:py313]
69+
basepython = python3.13

0 commit comments

Comments
 (0)