blob: ca089bd75100a0ffdf790e00c38ec1fb18c9a7d6 [file] [log] [blame] [edit]
[tox]
envlist = docs, flake8, isort, validate-pyproject
[testenv:validate-pyproject]
skip_install = true
deps =
validate-pyproject==0.23
packaging==24.2
commands =
validate-pyproject ./pyproject.toml
[testenv:docs]
skip_install = true
deps =
-r {toxinidir}/docs/requirements.txt
-r {toxinidir}/requirements.txt
commands =
; regenerate autodoc stub pages
sphinx-autogen docs/source/api.rst
; build api docs
sphinx-build -b html -d ../build/docs/doctrees docs/source ../build/docs/api/py {posargs}
setenv =
PYTHONPATH = {toxinidir}/.
[testenv:mypy]
skip_install = true
deps =
mypy==1.4.1
lxml==4.9.1
types-urllib3==1.26.25
types-certifi==2021.10.8.3
trio-typing==0.7.0
commands = mypy --install-types {posargs}
[testenv:linting-ci]
; checks linting for CI with stricter exiting when failing.
skip_install = true
deps =
isort==5.13.2
black==24.1.1
flake8==6.1.0
flake8-typing-imports==1.14.0
docformatter==1.7.5
commands =
; execute isort in check only mode.
isort --check-only --diff selenium/ test/ conftest.py
; execute black in check only mode with diff.
black --check --diff selenium/ test/ conftest.py -l 120
flake8 selenium/ test/ --min-python-version=3.9
docformatter --check -r selenium/
[testenv:linting]
; A consolidated linting based recipe, responsible for executing linting tools across the code base.
; This encompasses isort for imports, black for general formatting and flake8.
; IMPORTANT: black & isort rewrite files, flake8 merely alerts to the failure.
skip_install = true
deps =
isort==5.13.2
black==24.1.1
flake8==6.1.0
flake8-typing-imports==1.14.0
docformatter==1.7.5
commands =
isort selenium/ test/ conftest.py
black selenium/ test/ conftest.py -l 120
flake8 selenium/ test/ --min-python-version=3.9
docformatter --in-place -r selenium/
[flake8]
exclude = .tox,docs/source/conf.py,*venv
# Disable this once black is applied throughout & line length is better handled.
extend-ignore = E501, E203
# This does nothing for now as E501 is ignored.
max-line-length = 120