Skip to content

Commit f087cee

Browse files
WIP: fix rebase artifacts
1 parent 4bc502b commit f087cee

File tree

6 files changed

+21
-23
lines changed

6 files changed

+21
-23
lines changed

src/pluggy/_callers.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
import warnings
88

99
from ._hooks import HookImpl
10-
from ._result import _raise_wrapfail
1110
from ._result import HookCallError
1211
from ._result import Result
12+
from ._warnings import PluggyTeardownRaisedWarning
13+
1314

1415
TYPE_CHECKING = False
1516
if TYPE_CHECKING:
@@ -21,25 +22,17 @@
2122
from typing import Tuple
2223
from typing import Union
2324

24-
2525
# Need to distinguish between old- and new-style hook wrappers.
2626
# Wrapping with a tuple is the fastest type-safe way I found to do it.
2727
Teardown = Union[
2828
Tuple[Generator[None, Result[object], None], HookImpl],
29-
Generator[None, object, object],
30-
]
29+
Generator[None, object, object],
30+
]
3131
else:
3232

3333
def cast(t, v):
3434
return v
3535

36-
from ._hooks import HookImpl
37-
from ._result import HookCallError
38-
from ._result import Result
39-
from ._warnings import PluggyTeardownRaisedWarning
40-
41-
42-
4336

4437
def _raise_wrapfail(
4538
wrap_controller: (

src/pluggy/_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
import warnings
99

10+
1011
_Plugin = object
1112

1213
TYPE_CHECKING = False
@@ -383,12 +384,11 @@ def __getattr__(self, name: str) -> HookCaller: ...
383384

384385
_CallHistory = List[Tuple[Mapping[str, object], Optional[Callable[[Any], None]]]]
385386

387+
386388
# Historical name (pluggy<=1.2), kept for backward compatibility.
387389
_HookRelay = HookRelay
388390

389391

390-
391-
392392
class HookCaller:
393393
"""A caller of all registered implementations of a hook specification."""
394394

src/pluggy/_importlib_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1010
1111
"""
12+
1213
from __future__ import annotations
1314

1415
import importlib.metadata

src/pluggy/_manager.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@
1616

1717
TYPE_CHECKING = False
1818
if TYPE_CHECKING:
19-
from ._hooks import HookimplOpts
20-
from ._hooks import HookspecOpts
21-
22-
from ._hooks import _HookImplFunction
23-
from ._hooks import _Namespace
24-
19+
from importlib.metadata import Distribution
2520
from typing import Any
2621
from typing import Callable
2722
from typing import Final
2823
from typing import Iterable
2924
from typing import Mapping
3025
from typing import Sequence
3126
from typing import TypeAlias
32-
from importlib.metadata import Distribution
27+
28+
from ._hooks import _HookImplFunction
29+
from ._hooks import _Namespace
30+
from ._hooks import HookimplOpts
31+
from ._hooks import HookspecOpts
3332
from ._importlib_metadata import DistFacade
3433

3534
_BeforeTrace: TypeAlias = "Callable[[str, Sequence[HookImpl], Mapping[str, Any]], None]"

src/pluggy/_result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
from __future__ import annotations
66

7+
78
TYPE_CHECKING = False
89
if TYPE_CHECKING:
910
from types import TracebackType
1011
from typing import Callable
1112
from typing import cast
1213
from typing import final
13-
from typing import Generic
14-
14+
from typing import Generic
1515
from typing import Optional
1616
from typing import Tuple
1717
from typing import Type

src/pluggy/_tracing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44

55
from __future__ import annotations
66

7+
78
TYPE_CHECKING = False
89
if TYPE_CHECKING:
9-
from typing import Sequence, TypeAlias, Callable, Any, Tuple
10+
from typing import Any
11+
from typing import Callable
12+
from typing import Sequence
13+
from typing import Tuple
14+
from typing import TypeAlias
1015

1116

1217
_Writer: TypeAlias = "Callable[[str], object]"

0 commit comments

Comments
 (0)