Skip to content

Commit 1590a82

Browse files
[pre-commit.ci] pre-commit autoupdate (#681)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <[email protected]>
1 parent a066050 commit 1590a82

File tree

10 files changed

+15
-14
lines changed

10 files changed

+15
-14
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
- id: python-no-log-warn
2929
- id: text-unicode-replacement-char
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.11.12
31+
rev: v0.12.0
3232
hooks:
3333
- id: ruff-format
3434
- id: ruff
@@ -58,7 +58,7 @@ repos:
5858
- id: nbstripout
5959
exclude: (docs)
6060
- repo: https://github.com/crate-ci/typos
61-
rev: v1.32.0
61+
rev: v1
6262
hooks:
6363
- id: typos
6464
exclude: (\.ipynb)

src/_pytask/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def build( # noqa: C901, PLR0912, PLR0913
222222
if "command" not in raw_config:
223223
raw_config["command"] = "build"
224224
# Add defaults from cli.
225-
from _pytask.cli import DEFAULTS_FROM_CLI
225+
from _pytask.cli import DEFAULTS_FROM_CLI # noqa: PLC0415
226226

227227
raw_config = {**DEFAULTS_FROM_CLI, **raw_config}
228228

src/_pytask/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _make_memoize_key(
7272
if kwargs:
7373
for i, arg in enumerate(argspec.args):
7474
if arg in kwargs:
75-
args = args[:i] + (kwargs.pop(arg),) + args[i:]
75+
args = (*args[:i], kwargs.pop(arg), *args[i:])
7676

7777
if args:
7878
key_args += args

src/_pytask/dag_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def build_dag(raw_config: dict[str, Any]) -> nx.DiGraph:
151151
if "command" not in raw_config:
152152
raw_config["command"] = "dag"
153153
# Add defaults from cli.
154-
from _pytask.cli import DEFAULTS_FROM_CLI
154+
from _pytask.cli import DEFAULTS_FROM_CLI # noqa: PLC0415
155155

156156
raw_config = {**DEFAULTS_FROM_CLI, **raw_config}
157157

src/_pytask/debugging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _import_pdb_cls(
133133
) -> type[pdb.Pdb]:
134134
"""Create a debugger from an imported class."""
135135
if not cls._config:
136-
import pdb # noqa: T100
136+
import pdb # noqa: PLC0415, T100
137137

138138
# Happens when using pytask.set_trace outside of a task.
139139
return pdb.Pdb
@@ -160,7 +160,7 @@ def _import_pdb_cls(
160160
msg = f"--pdbcls: could not import {value!r}: {exc}."
161161
raise ValueError(msg) from exc
162162
else:
163-
import pdb # noqa: T100
163+
import pdb # noqa: PLC0415, T100
164164

165165
pdb_cls = pdb.Pdb
166166

src/_pytask/mark/expression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def not_expr(s: Scanner) -> ast.expr:
179179
ident = s.accept(TokenType.IDENT)
180180
if ident:
181181
return ast.Name(IDENT_PREFIX + ident.value, ast.Load())
182-
s.reject((TokenType.NOT, TokenType.LPAREN, TokenType.IDENT)) # noqa: RET503
182+
s.reject((TokenType.NOT, TokenType.LPAREN, TokenType.IDENT))
183+
return None
183184

184185

185186
class MatcherAdapter(Mapping[str, bool]):

src/_pytask/warnings_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _resolve_warning_category(category: str) -> type[Warning]:
119119
return Warning
120120

121121
if "." not in category:
122-
import builtins as m
122+
import builtins as m # noqa: PLC0415
123123

124124
klass = category
125125
else:

tests/test_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def test_unicode_and_str_mixture(self):
398398

399399

400400
def test_dontreadfrominput():
401-
from _pytest.capture import DontReadFromInput
401+
from _pytest.capture import DontReadFromInput # noqa: PLC0415
402402

403403
f = DontReadFromInput()
404404
assert f.buffer is f

tests/test_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_bad_version(monkeypatch):
109109
result = import_optional_dependency("fakemodule", min_version="0.8")
110110
assert result is module
111111

112-
with pytest.warns(UserWarning):
112+
with pytest.warns(UserWarning, match=match):
113113
result = import_optional_dependency("fakemodule", errors="warn")
114114
assert result is None
115115

@@ -134,7 +134,7 @@ def test_submodule(monkeypatch):
134134
with pytest.raises(ImportError, match=match):
135135
import_optional_dependency("fakemodule.submodule")
136136

137-
with pytest.warns(UserWarning):
137+
with pytest.warns(UserWarning, match=match):
138138
result = import_optional_dependency("fakemodule.submodule", errors="warn")
139139
assert result is None
140140

tests/test_path.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_no_meta_path_found(
164164
assert module.foo(2) == 42 # type: ignore[attr-defined]
165165

166166
# mode='importlib' fails if no spec is found to load the module
167-
import importlib.util
167+
import importlib.util # noqa: PLC0415
168168

169169
# Force module to be re-imported.
170170
del sys.modules[module.__name__]
@@ -269,7 +269,7 @@ class Data:
269269
)
270270
)
271271

272-
import pickle
272+
import pickle # noqa: PLC0415
273273

274274
def round_trip(obj):
275275
s = pickle.dumps(obj)

0 commit comments

Comments
 (0)