Files
fastapi-cache/tox.ini
Martijn Pieters 1d9e126037 Switch to ruff to handle linting and formatting
Ruff handles black, flake8 and isort in one package, and is way faster.
The isort rules had not been enforced, so this commit includes a lot
of import resorting changes.

I switched to flake8-bugbear and the standard black-compatible line
length of 80 + 10% (so max 88 characters), so some line reflowing is
included too.

Finally, because bugbear rightly points out that `setattr()` is less
performant, I've switched the `__signature__` assigment back to using
a direct assignment with type ignore comment.
2023-05-16 12:18:24 +01:00

46 lines
1011 B
INI

[tox]
env_list =
py37,py38,py39,py310,py311
minversion = 4.5.1
[gh-actions]
# Map Github Actions Python version to environment factors
# Requires tox-gh-actions 3.x is installed in the GitHub action
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[testenv]
description = Run the tests with pytest
package = wheel
extras = all
set_env =
# trick poetry into adopting the tox virtualenv
POETRY_VIRTUALENVS_PATH = {[tox]work_dir}
allowlist_externals = poetry
commands_pre =
poetry install --no-root --sync --all-extras
commands =
python -X dev -m pytest {tty:--color=yes} {posargs}
[testenv:lint]
description = Run the linters
skip_install = true
commands_pre =
poetry install --no-root --with=linting --sync --all-extras
commands =
ruff check --show-source .
mypy
pyright
[testenv:format]
description = Format the code
skip_install = true
commands_pre =
poetry install --no-root --sync --with=linting
commands =
ruff check --fix .