|
1 | 1 | """Contains code relevant to the execution."""
|
| 2 | + |
2 | 3 | from __future__ import annotations
|
3 | 4 |
|
4 | 5 | import inspect
|
5 | 6 | import sys
|
6 | 7 | import time
|
7 | 8 | import warnings
|
8 |
| -from concurrent.futures import Future |
9 | 9 | from functools import partial
|
10 |
| -from pathlib import Path |
11 |
| -from types import ModuleType |
12 |
| -from types import TracebackType |
| 10 | +from typing import TYPE_CHECKING |
13 | 11 | from typing import Any
|
14 | 12 | from typing import Callable
|
15 | 13 |
|
16 | 14 | import cloudpickle
|
17 | 15 | from attrs import define
|
18 | 16 | from attrs import field
|
19 |
| -from pytask import console |
20 | 17 | from pytask import ExecutionReport
|
21 |
| -from pytask import get_marks |
22 |
| -from pytask import hookimpl |
23 | 18 | from pytask import Mark
|
24 |
| -from pytask import parse_warning_filter |
25 | 19 | from pytask import PNode
|
26 | 20 | from pytask import PTask
|
27 | 21 | from pytask import PythonNode
|
28 |
| -from pytask import remove_internal_traceback_frames_from_exc_info |
29 | 22 | from pytask import Session
|
30 | 23 | from pytask import Task
|
31 |
| -from pytask import warning_record_to_str |
32 | 24 | from pytask import WarningReport
|
| 25 | +from pytask import console |
| 26 | +from pytask import get_marks |
| 27 | +from pytask import hookimpl |
| 28 | +from pytask import parse_warning_filter |
| 29 | +from pytask import remove_internal_traceback_frames_from_exc_info |
| 30 | +from pytask import warning_record_to_str |
33 | 31 | from pytask.tree_util import PyTree
|
34 | 32 | from pytask.tree_util import tree_leaves
|
35 | 33 | from pytask.tree_util import tree_map
|
36 | 34 | from pytask.tree_util import tree_structure
|
| 35 | +from rich.traceback import Traceback |
| 36 | + |
37 | 37 | from pytask_parallel.backends import PARALLEL_BACKENDS
|
38 | 38 | from pytask_parallel.backends import ParallelBackend
|
39 |
| -from rich.console import ConsoleOptions |
40 |
| -from rich.traceback import Traceback |
| 39 | + |
| 40 | +if TYPE_CHECKING: |
| 41 | + from concurrent.futures import Future |
| 42 | + from pathlib import Path |
| 43 | + from types import ModuleType |
| 44 | + from types import TracebackType |
| 45 | + |
| 46 | + from rich.console import ConsoleOptions |
41 | 47 |
|
42 | 48 |
|
43 | 49 | @hookimpl
|
|
0 commit comments