Skip to content

Commit a484d56

Browse files
authored
Update to current versions of pre-commit hooks. (#312)
1 parent 3447ea8 commit a484d56

File tree

3 files changed

+38
-42
lines changed

3 files changed

+38
-42
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
---
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.2.2
4+
rev: v0.14.0
55
hooks:
66
- id: ruff-format
77
args: ["--preview"]
88
- id: ruff
99
args: ["--exit-non-zero-on-fix"]
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.5.0
11+
rev: v6.0.0
1212
hooks:
13-
- id: trailing-whitespace
14-
- id: end-of-file-fixer
15-
- id: fix-encoding-pragma
16-
args: [--remove]
17-
- id: check-yaml
18-
- id: debug-statements
19-
language_version: python3
13+
- id: trailing-whitespace
14+
- id: end-of-file-fixer
15+
- id: check-yaml
16+
- id: debug-statements
17+
language_version: python3
18+
- repo: https://github.com/asottile/pyupgrade
19+
rev: v3.21.0
20+
hooks:
21+
- id: pyupgrade
22+
args: [--py310-plus]
2023
- repo: https://github.com/sphinx-contrib/sphinx-lint
21-
rev: v0.9.1
24+
rev: v1.0.0
2225
hooks:
2326
- id: sphinx-lint
2427
args: [--enable=default-role]
2528
- repo: https://github.com/tox-dev/pyproject-fmt
26-
rev: 1.7.0
29+
rev: v2.10.0
2730
hooks:
2831
- id: pyproject-fmt
2932
additional_dependencies: [ tox ]

pyproject.toml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,18 @@ requires = [
44
"setuptools>=40",
55
]
66

7-
[tool.check-manifest]
8-
ignore = [".pre-commit-config.yaml"]
9-
107
[project]
118
name = "pytest-rerunfailures"
129
version = "16.2.dev0"
1310
description = "pytest plugin to re-run tests to eliminate flaky failures"
14-
dynamic = [
15-
"readme",
16-
]
1711
keywords = [
1812
"failures",
1913
"flaky",
2014
"pytest",
2115
"rerun",
2216
]
2317
license.text = "MPL-2.0"
24-
authors = [{name = "Leah Klearman", email = "[email protected]"}]
18+
authors = [ { name = "Leah Klearman", email = "[email protected]" } ]
2519
requires-python = ">=3.10"
2620
classifiers = [
2721
"Development Status :: 5 - Production/Stable",
@@ -42,38 +36,37 @@ classifiers = [
4236
"Topic :: Software Development :: Testing",
4337
"Topic :: Utilities",
4438
]
39+
dynamic = [
40+
"readme",
41+
]
4542
dependencies = [
4643
"packaging>=17.1",
4744
"pytest!=8.2.2,>=7.4",
4845
]
49-
urls = {Homepage = "https://github.com/pytest-dev/pytest-rerunfailures"}
46+
urls = { Homepage = "https://github.com/pytest-dev/pytest-rerunfailures" }
47+
48+
entry-points.pytest11.rerunfailures = "pytest_rerunfailures"
5049

5150
[tool.setuptools.dynamic]
52-
readme = {file = ["HEADER.rst", "README.rst", "CHANGES.rst"]}
51+
readme = { file = [ "HEADER.rst", "README.rst", "CHANGES.rst" ] }
5352

54-
[project.entry-points.pytest11]
55-
rerunfailures = "pytest_rerunfailures"
5653
[tool.ruff]
5754
fix = true
5855
lint.select = [
59-
"E", # https://pypi.org/project/pyflakes/
60-
"W", # https://pypi.org/project/pycodestyle/
61-
"F", # https://pypi.org/project/pyflakes/
62-
"I", # https://pypi.org/project/isort/
63-
"S", # https://pypi.org/project/flake8-bandit/
64-
"UP", # https://pypi.org/project/upgrade-checker/
56+
"E", # https://pypi.org/project/pyflakes/
57+
"F", # https://pypi.org/project/pyflakes/
58+
"I", # https://pypi.org/project/isort/
59+
"S", # https://pypi.org/project/flake8-bandit/
60+
"UP", # https://pypi.org/project/upgrade-checker/
61+
"W", # https://pypi.org/project/pycodestyle/
6562
]
6663

67-
[tool.ruff.lint.isort]
68-
known-first-party = ["pytest_rerunfailures"]
69-
70-
[tool.ruff.lint.per-file-ignores]
71-
"test_*.py" = ["S101", "S311"]
72-
73-
[tool.ruff.lint.pydocstyle]
64+
lint.per-file-ignores."test_*.py" = [ "S101", "S311" ]
65+
lint.isort.known-first-party = [ "pytest_rerunfailures" ]
66+
# Unlike Flake8, default to a complexity level of 10.
67+
lint.mccabe.max-complexity = 10
7468
# Use Google-style docstrings.
75-
convention = "google"
69+
lint.pydocstyle.convention = "google"
7670

77-
[tool.ruff.lint.mccabe]
78-
# Unlike Flake8, default to a complexity level of 10.
79-
max-complexity = 10
71+
[tool.check-manifest]
72+
ignore = [ ".pre-commit-config.yaml" ]

src/pytest_rerunfailures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ def evaluate_condition(item, mark, condition: object) -> bool:
206206
result = eval(condition_code, globals_) # noqa: S307
207207
except SyntaxError as exc:
208208
msglines = [
209-
"Error evaluating %r condition" % mark.name,
209+
f"Error evaluating {mark.name!r} condition",
210210
" " + condition,
211211
" " + " " * (exc.offset or 0) + "^",
212212
"SyntaxError: invalid syntax",
213213
]
214214
fail("\n".join(msglines), pytrace=False)
215215
except Exception as exc:
216216
msglines = [
217-
"Error evaluating %r condition" % mark.name,
217+
f"Error evaluating {mark.name!r} condition",
218218
" " + condition,
219219
*traceback.format_exception_only(type(exc), exc),
220220
]
@@ -226,7 +226,7 @@ def evaluate_condition(item, mark, condition: object) -> bool:
226226
result = bool(condition)
227227
except Exception as exc:
228228
msglines = [
229-
"Error evaluating %r condition as a boolean" % mark.name,
229+
f"Error evaluating {mark.name!r} condition as a boolean",
230230
*traceback.format_exception_only(type(exc), exc),
231231
]
232232
fail("\n".join(msglines), pytrace=False)

0 commit comments

Comments
 (0)