11[tox]
2- envlist = py39,310,311,312,313
2+ # Define environments to run for comprehensive testing.
3+ # py39, py310, py311, py312, py313 are standard test environments.
4+ # lint and format-check are added for code quality assurance.
5+ envlist = py{39,10,11,12,13}, lint, format-check
6+
7+ # Ensures the project's source distribution is built in isolation before installing.
38isolated_build = true
49
10+ # ------------------------------------
11+ # Base Configuration for Test Environments (py39, py310, etc.)
12+ # ------------------------------------
513[testenv]
14+ # Dependencies needed to run tests (pytest itself).
615deps = pytest
16+ # Explicitly allow external commands (Poetry) for security/modern tox versions.
717allowlist_externals = poetry
18+ # Ensure all project dependencies are installed by Poetry first.
19+ # Note: This relies on 'poetry install' respecting the environment and installing test dependencies.
820commands_pre =
9- poetry install -v
21+ poetry install
22+ # Run the tests.
23+ commands =
24+ pytest
25+
26+ # ------------------------------------
27+ # Code Quality - LINTING Environment
28+ # Checks static code analysis (style and types)
29+ # ------------------------------------
30+ [testenv:lint]
31+ skip_install = True
32+ # Linting tools: flake8 for style/errors, mypy for type checking.
33+ deps =
34+ flake8
35+ mypy
36+ poetry
37+ # Check all Python files
38+ commands =
39+ flake8 .
40+ mypy .
41+
42+ # ------------------------------------
43+ # Code Quality - FORMAT CHECK Environment
44+ # Checks code formatting using Black (no auto-fix).
45+ # ------------------------------------
46+ [testenv:format-check]
47+ skip_install = True
48+ # Black is the standard formatter.
49+ deps =
50+ black
51+ poetry
52+ # Check all files recursively without modifying them (-c is check-only).
1053commands =
11- pytest
54+ black --check .
0 commit comments