diff --git a/tox.ini b/tox.ini index a5106a4..09ba92a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,49 @@ +# tox configuration for running tests and checks across multiple environments. [tox] -envlist = py36,py37,py38,py39 +# List of environments to run by default (using 'tox'). +# Includes modern Python versions (3.9+) and critical code quality checks. +envlist = py39, py310, py311, py312, lint, mypy +# ================================== +# Base Configuration for Testing +# ================================== [testenv] +description = Run tests for Python {basepython} +# Use the corresponding python version installed on the system +basepython = + py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 + +# Install dependencies from the test requirements file +deps = + -r requirements/requirements-test.txt + +# Commands to execute (running pytest with verbosity) +commands = + pytest -v + +# ================================== +# Code Quality Checks +# ================================== + +# Environment for running code style checks (e.g., Flake8) +[testenv:lint] +description = Check code style with Flake8 +skip_install = True +deps = + flake8 +commands = + flake8 {toxinidir} + +# Environment for running static type checks (e.g., Mypy) +[testenv:mypy] +description = Run static type checking with Mypy +skip_install = True deps = - -rrequirements/requirements-test.txt + mypy + # Install test dependencies for type checking context (optional but recommended) + -r requirements/requirements-test.txt commands = - pytest + mypy {toxinidir}