Skip to content

Commit 5affb8a

Browse files
committed
Replace pre-commit with prek
1 parent 1dace05 commit 5affb8a

7 files changed

Lines changed: 26 additions & 18 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: '3.x'
16-
- name: Install pre-commit
17-
run: python -m pip install pre-commit
18-
- name: Run pre-commit
19-
run: pre-commit run --all-files
12+
- uses: jdx/mise-action@v2
13+
- name: Lint
14+
run: mise lint
2015

2116
test:
2217
strategy:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.6
3+
rev: v0.13.1
44
hooks:
55
- id: ruff-format
66
args: [., --check]
@@ -10,6 +10,6 @@ repos:
1010
args: [., --fix, --exit-non-zero-on-fix, --show-fixes]
1111

1212
- repo: https://github.com/pre-commit/mirrors-mypy
13-
rev: v1.15.0
13+
rev: v1.18.1
1414
hooks:
1515
- id: mypy

mise.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[hooks]
2+
enter = "mise install"
3+
4+
[env]
5+
VENV = ".venv"
6+
_.python.venv = { path = "{{env.VENV}}", create = true }
7+
UV_PROJECT_ENVIRONMENT = "{{env.VENV}}"
8+
9+
[tools]
10+
python = "3.10"
11+
prek = "latest"
12+
13+
[tasks.lint]
14+
run = "prek run --all-files"

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ignore = [
2323
"S101", # Use of `assert` detected
2424
"SIM201", # negate-equal-op
2525
"SIM202", # negate-not-equal-op
26-
"UP038", # non-pep604-isinstance: This rule is deprecated
2726
]
2827

2928
[tool.ruff.lint.isort]

pytest_unordered/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from _pytest.config import Config
1515

1616

17-
class UnorderedList(list):
17+
class UnorderedList(list): # noqa: PLW1641
1818
def __init__(self, expected: Iterable, *, check_type: bool = True) -> None:
1919
if not isinstance(expected, Iterable):
2020
msg = f"cannot make unordered comparisons to non-iterable: {expected!r}"

tests/test_unordered.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ def test_mock_any() -> None:
271271
(unordered_deep([1, 2, 3]), [3, 2, 1]),
272272
(unordered_deep((1, 2, 3)), (3, 2, 1)),
273273
(unordered_deep({1, 2, 3}), {3, 2, 1}),
274-
(unordered_deep([1, 2, {"a": (4, 5, 6)}]), [{"a": [6, 5, 4]}, 2, 1]), # fmt: skip
275-
(unordered_deep([{1: (["a", "b"])}, 2, 3]), [3, 2, {1: ["b", "a"]}]), # fmt: skip
274+
(unordered_deep([1, 2, {"a": (4, 5, 6)}]), [{"a": [6, 5, 4]}, 2, 1]),
275+
(unordered_deep([{1: (["a", "b"])}, 2, 3]), [3, 2, {1: ["b", "a"]}]),
276276
(unordered_deep(("a", "b", "c")), ["b", "a", "c"]),
277277
],
278278
)

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist =
33
{py38,py39}-{pytest7,pytest8},
44
{py310,py311,py312,py313,pypy3}-{pytest7,pytest8,pytestlatest},
5-
pre-commit
5+
prek
66

77
[testenv]
88
commands =
@@ -14,7 +14,7 @@ deps =
1414
pytest8: pytest>=8.1.1,<9
1515
pytestlatest: pytest
1616

17-
[testenv:pre-commit]
17+
[testenv:prek]
1818
skip_install = true
19-
deps = pre-commit
20-
commands = pre-commit run --all-files
19+
deps = prek
20+
commands = prek run --all-files

0 commit comments

Comments
 (0)