Skip to content

Commit afb9f75

Browse files
authoredMar 13, 2024··
[pre-commit.ci] pre-commit autoupdate (#487)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c65e5d9 commit afb9f75

File tree

4 files changed

+24
-46
lines changed

4 files changed

+24
-46
lines changed
 

‎.pre-commit-config.yaml

+2-2
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.2.2"
3+
rev: "v0.3.2"
44
hooks:
55
- id: ruff
66
args: ["--fix"]
@@ -43,7 +43,7 @@ repos:
4343
language: python
4444
additional_dependencies: [pygments, restructuredtext_lint]
4545
- repo: https://github.com/pre-commit/mirrors-mypy
46-
rev: v1.8.0
46+
rev: v1.9.0
4747
hooks:
4848
- id: mypy
4949
files: ^(src/|testing/)

‎src/pluggy/_hooks.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ def __call__(
9292
firstresult: bool = False,
9393
historic: bool = False,
9494
warn_on_impl: Warning | None = None,
95-
) -> _F:
96-
...
95+
) -> _F: ...
9796

9897
@overload # noqa: F811
9998
def __call__( # noqa: F811
@@ -102,8 +101,7 @@ def __call__( # noqa: F811
102101
firstresult: bool = ...,
103102
historic: bool = ...,
104103
warn_on_impl: Warning | None = ...,
105-
) -> Callable[[_F], _F]:
106-
...
104+
) -> Callable[[_F], _F]: ...
107105

108106
def __call__( # noqa: F811
109107
self,
@@ -173,8 +171,7 @@ def __call__(
173171
trylast: bool = ...,
174172
specname: str | None = ...,
175173
wrapper: bool = ...,
176-
) -> _F:
177-
...
174+
) -> _F: ...
178175

179176
@overload # noqa: F811
180177
def __call__( # noqa: F811
@@ -186,8 +183,7 @@ def __call__( # noqa: F811
186183
trylast: bool = ...,
187184
specname: str | None = ...,
188185
wrapper: bool = ...,
189-
) -> Callable[[_F], _F]:
190-
...
186+
) -> Callable[[_F], _F]: ...
191187

192188
def __call__( # noqa: F811
193189
self,
@@ -357,8 +353,7 @@ def __init__(self) -> None:
357353

358354
if TYPE_CHECKING:
359355

360-
def __getattr__(self, name: str) -> HookCaller:
361-
...
356+
def __getattr__(self, name: str) -> HookCaller: ...
362357

363358

364359
# Historical name (pluggy<=1.2), kept for backward compatibility.

‎testing/test_hookcaller.py

+9-18
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,17 @@ def m1():
212212
assert funcs(hc.get_hookimpls()) == [m1]
213213

214214
@addmeth()
215-
def m2() -> None:
216-
...
215+
def m2() -> None: ...
217216

218217
assert funcs(hc.get_hookimpls()) == [m2, m1]
219218

220219
@addmeth(trylast=True)
221-
def m3() -> None:
222-
...
220+
def m3() -> None: ...
223221

224222
assert funcs(hc.get_hookimpls()) == [m3, m2, m1]
225223

226224
@addmeth(hookwrapper=True)
227-
def m4() -> None:
228-
...
225+
def m4() -> None: ...
229226

230227
assert funcs(hc.get_hookimpls()) == [m3, m2, m1, m4]
231228

@@ -236,14 +233,12 @@ def m5():
236233
assert funcs(hc.get_hookimpls()) == [m3, m2, m1, m4, m5]
237234

238235
@addmeth(tryfirst=True)
239-
def m6() -> None:
240-
...
236+
def m6() -> None: ...
241237

242238
assert funcs(hc.get_hookimpls()) == [m3, m2, m6, m1, m4, m5]
243239

244240
@addmeth()
245-
def m7() -> None:
246-
...
241+
def m7() -> None: ...
247242

248243
assert funcs(hc.get_hookimpls()) == [m3, m2, m7, m6, m1, m4, m5]
249244

@@ -254,20 +249,17 @@ def m8():
254249
assert funcs(hc.get_hookimpls()) == [m3, m2, m7, m6, m1, m4, m8, m5]
255250

256251
@addmeth(trylast=True)
257-
def m9() -> None:
258-
...
252+
def m9() -> None: ...
259253

260254
assert funcs(hc.get_hookimpls()) == [m9, m3, m2, m7, m6, m1, m4, m8, m5]
261255

262256
@addmeth(tryfirst=True)
263-
def m10() -> None:
264-
...
257+
def m10() -> None: ...
265258

266259
assert funcs(hc.get_hookimpls()) == [m9, m3, m2, m7, m6, m10, m1, m4, m8, m5]
267260

268261
@addmeth(hookwrapper=True, trylast=True)
269-
def m11() -> None:
270-
...
262+
def m11() -> None: ...
271263

272264
assert funcs(hc.get_hookimpls()) == [m9, m3, m2, m7, m6, m10, m11, m1, m4, m8, m5]
273265

@@ -291,8 +283,7 @@ def m12():
291283
]
292284

293285
@addmeth()
294-
def m13() -> None:
295-
...
286+
def m13() -> None: ...
296287

297288
assert funcs(hc.get_hookimpls()) == [
298289
m9,

‎testing/test_pluginmanager.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ def he_method1(self):
181181
def test_register(pm: PluginManager) -> None:
182182
class MyPlugin:
183183
@hookimpl
184-
def he_method1(self):
185-
...
184+
def he_method1(self): ...
186185

187186
my = MyPlugin()
188187
pm.register(my)
@@ -256,8 +255,7 @@ def he_method1(self, arg):
256255
def test_historic_with_subset_hook_caller(pm: PluginManager) -> None:
257256
class Hooks:
258257
@hookspec(historic=True)
259-
def he_method1(self, arg):
260-
...
258+
def he_method1(self, arg): ...
261259

262260
pm.add_hookspecs(Hooks)
263261

@@ -520,33 +518,27 @@ class PluginNo:
520518
def test_get_hookcallers(pm: PluginManager) -> None:
521519
class Hooks:
522520
@hookspec
523-
def he_method1(self):
524-
...
521+
def he_method1(self): ...
525522

526523
@hookspec
527-
def he_method2(self):
528-
...
524+
def he_method2(self): ...
529525

530526
pm.add_hookspecs(Hooks)
531527

532528
class Plugin1:
533529
@hookimpl
534-
def he_method1(self):
535-
...
530+
def he_method1(self): ...
536531

537532
@hookimpl
538-
def he_method2(self):
539-
...
533+
def he_method2(self): ...
540534

541535
class Plugin2:
542536
@hookimpl
543-
def he_method1(self):
544-
...
537+
def he_method1(self): ...
545538

546539
class Plugin3:
547540
@hookimpl
548-
def he_method2(self):
549-
...
541+
def he_method2(self): ...
550542

551543
plugin1 = Plugin1()
552544
pm.register(plugin1)

0 commit comments

Comments
 (0)
Please sign in to comment.