diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f17e792..bef06f2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,11 @@ repos: hooks: - id: check-merge-conflict exclude: rst$ +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.0 + hooks: + - id: ruff + args: [--fix] - repo: https://github.com/asottile/yesqa rev: v1.5.0 hooks: @@ -43,11 +48,6 @@ repos: exclude: ^(docs|tests)/.* additional_dependencies: - pytest -- repo: https://github.com/pycqa/flake8 - rev: 7.1.1 - hooks: - - id: flake8 - language_version: python3 - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: @@ -68,6 +68,12 @@ repos: rev: 0.29.3 hooks: - id: check-github-actions +- repo: https://github.com/tox-dev/pyproject-fmt + rev: 2.3.1 + hooks: + - id: pyproject-fmt + # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version + additional_dependencies: [tox>=4.9] ci: skip: - actionlint-docker diff --git a/pyproject.toml b/pyproject.toml index 81540a53..da02e5c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,19 @@ [build-system] +build-backend = "setuptools.build_meta" + requires = [ - "setuptools>=51.0", + "setuptools>=51", + "setuptools-scm[toml]>=6.2", "wheel>=0.36", - "setuptools_scm[toml]>=6.2" ] -build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "pytest_asyncio/_version.py" + +[tool.ruff] +line-length = 88 +lint.select = [ + "E", # pycodestyle + "F", # pyflakes + "W", # pycodestyle +] diff --git a/setup.cfg b/setup.cfg index 3ae1ed28..886b9d62 100644 --- a/setup.cfg +++ b/setup.cfg @@ -74,6 +74,3 @@ junit_family=xunit2 filterwarnings = error ignore:The event_loop fixture provided by pytest-asyncio has been redefined.*:DeprecationWarning - -[flake8] -max-line-length = 88 diff --git a/tox.ini b/tox.ini index bdf37f77..d6e65df9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 3.14.0 +minversion = 4.9.0 envlist = py39, py310, py311, py312, py13, pytest-min, docs isolated_build = true passenv =