11[tox]
2- envlist = py39,310,311,312,313
2+ # Define environments to run for comprehensive testing.
3+ # py39, py310, py311, py312, py313, py314 are standard test environments.
4+ # lint and format-check are added for code quality assurance.
5+ envlist = py{39,10,11,12,13,14}, 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 for type checking.
33+ deps =
34+ flake8
35+ poetry
36+ # Check all Python files
37+ commands =
38+ flake8 --max-line-length 120 .
39+
40+ # ------------------------------------
41+ # Code Quality - FORMAT CHECK Environment
42+ # Checks code formatting using Black (no auto-fix).
43+ # ------------------------------------
44+ [testenv:format-check]
45+ skip_install = True
46+ # Black is the standard formatter.
47+ deps =
48+ black
49+ poetry
50+ # Check all files recursively without modifying them (-c is check-only).
1051commands =
11- pytest
52+ black --check .
0 commit comments