-
Notifications
You must be signed in to change notification settings - Fork 678
Expand file tree
/
Copy pathtox.ini
More file actions
52 lines (48 loc) · 1.63 KB
/
tox.ini
File metadata and controls
52 lines (48 loc) · 1.63 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
[tox]
# Define environments to run for comprehensive testing.
# py39, py310, py311, py312, py313, py314 are standard test environments.
# lint and format-check are added for code quality assurance.
envlist = py{39,10,11,12,13,14}, lint, format-check
# Ensures the project's source distribution is built in isolation before installing.
isolated_build = true
# ------------------------------------
# Base Configuration for Test Environments (py39, py310, etc.)
# ------------------------------------
[testenv]
# Dependencies needed to run tests (pytest itself).
deps = pytest
# Explicitly allow external commands (Poetry) for security/modern tox versions.
allowlist_externals = poetry
# Ensure all project dependencies are installed by Poetry first.
# Note: This relies on 'poetry install' respecting the environment and installing test dependencies.
commands_pre =
poetry install
# Run the tests.
commands =
pytest
# ------------------------------------
# Code Quality - LINTING Environment
# Checks static code analysis (style and types)
# ------------------------------------
[testenv:lint]
skip_install = True
# Linting tools: flake8 for style/errors for type checking.
deps =
flake8
poetry
# Check all Python files
commands =
flake8 --max-line-length 120 .
# ------------------------------------
# Code Quality - FORMAT CHECK Environment
# Checks code formatting using Black (no auto-fix).
# ------------------------------------
[testenv:format-check]
skip_install = True
# Black is the standard formatter.
deps =
black
poetry
# Check all files recursively without modifying them (-c is check-only).
commands =
black --check .