From a59e91827ecb3d2f8d13ae353361072091052be5 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Oct 2024 08:36:52 +0200 Subject: [PATCH 1/3] Add pyproject-fmt --- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f17e792..fe56a084 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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..8c4d9ea4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [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" From 88ce585c76c679459b18d0661a5a58d23c084545 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Oct 2024 08:45:08 +0200 Subject: [PATCH 2/3] [pre-commit] Replace flake8 by ruff --- .pre-commit-config.yaml | 10 +++++----- pyproject.toml | 8 ++++++++ setup.cfg | 3 --- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe56a084..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: diff --git a/pyproject.toml b/pyproject.toml index 8c4d9ea4..da02e5c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,3 +9,11 @@ requires = [ [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 From 20a1097063df1f4d49eadb0be5dbc664ff4bed0e Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Thu, 24 Oct 2024 09:56:11 +0200 Subject: [PATCH 3/3] [tox] Upgrade minimal version of tox See https://github.com/pytest-dev/pytest-asyncio/pull/970/files\#r1814442641 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 =