|
7 | 7 |
|
8 | 8 | from __future__ import annotations |
9 | 9 |
|
10 | | -# 6. UI (Terminal Interface) |
11 | | -# 5. Engine (Workflow Manager) |
12 | | -# 4. Execution (Workflow) |
13 | | -# Depends on IO and Utils |
14 | | -# 3. IO (Input/Output) |
15 | | -# Depends on Utils for logging/config |
| 10 | +# Import subpackages in dependency order (NOT alphabetical - order matters!) |
| 11 | +# isort: skip_file |
| 12 | + |
| 13 | +# 1. Utils (Foundation) - must be first, other modules depend on config/logging |
| 14 | +from . import utils # noqa: E402 |
| 15 | +from .utils import ( # noqa: E402 |
| 16 | + Timer, |
| 17 | + config, |
| 18 | + errors, |
| 19 | + hash, |
| 20 | + logging, |
| 21 | + optional_deps, |
| 22 | + progress, |
| 23 | + rate_limiter, |
| 24 | + symbols, |
| 25 | + text, |
| 26 | + timed, |
| 27 | + timeout_after, |
| 28 | +) |
| 29 | + |
16 | 30 | # 2. Data (Structures) |
17 | | -# Import subpackages (reordered for dependency resolution) |
18 | | -# 1. Utils (Foundation) |
19 | | -from . import data, engine, execution, io, ui, utils |
20 | | -from .data import ( |
| 31 | +from . import data # noqa: E402 |
| 32 | +from .data import ( # noqa: E402 |
21 | 33 | validate_not_empty, |
22 | 34 | validate_not_none, |
23 | 35 | validate_path_exists, |
|
26 | 38 | validate_type, |
27 | 39 | validation, |
28 | 40 | ) |
29 | | -from .engine import ( |
30 | | - SampleStage, |
31 | | - SampleState, |
32 | | - WorkflowManager, |
33 | | -) |
34 | | -from .execution import ( |
35 | | - cpu_count, |
36 | | - discover_configs, |
37 | | - discover_functions, |
38 | | - discovery, |
39 | | - parallel, |
40 | | - parallel_batch, |
41 | | - thread_map, |
42 | | - workflow, |
43 | | -) |
44 | | -from .io import ( |
| 41 | + |
| 42 | +# 3. IO (Input/Output) - depends on Utils for logging/config |
| 43 | +from . import io # noqa: E402 |
| 44 | +from .io import ( # noqa: E402 |
45 | 45 | atomic_replace, |
46 | 46 | atomic_write, |
47 | 47 | cache, |
|
53 | 53 | download_file, |
54 | 54 | dump_json, |
55 | 55 | ) |
56 | | -from .io import io as io_module |
57 | | -from .io import ( |
| 56 | +from .io import io as io_module # noqa: E402 |
| 57 | +from .io import ( # noqa: E402 |
58 | 58 | load_json, |
59 | 59 | load_yaml, |
60 | 60 | paths, |
|
65 | 65 | verify_checksum_file, |
66 | 66 | write_checksum_file, |
67 | 67 | ) |
68 | | -from .ui import ( |
| 68 | + |
| 69 | +# 4. Execution (Workflow) - depends on IO and Utils |
| 70 | +from . import execution # noqa: E402 |
| 71 | +from .execution import ( # noqa: E402 |
| 72 | + cpu_count, |
| 73 | + discover_configs, |
| 74 | + discover_functions, |
| 75 | + discovery, |
| 76 | + parallel, |
| 77 | + parallel_batch, |
| 78 | + thread_map, |
| 79 | + workflow, |
| 80 | +) |
| 81 | + |
| 82 | +# 5. Engine (Workflow Manager) |
| 83 | +from . import engine # noqa: E402 |
| 84 | +from .engine import ( # noqa: E402 |
| 85 | + SampleStage, |
| 86 | + SampleState, |
| 87 | + WorkflowManager, |
| 88 | +) |
| 89 | + |
| 90 | +# 6. UI (Terminal Interface) |
| 91 | +from . import ui # noqa: E402 |
| 92 | +from .ui import ( # noqa: E402 |
69 | 93 | ProgressState, |
70 | 94 | TerminalInterface, |
71 | 95 | ) |
72 | | -from .utils import ( |
73 | | - Timer, |
74 | | - config, |
75 | | - errors, |
76 | | - hash, |
77 | | - logging, |
78 | | - optional_deps, |
79 | | - progress, |
80 | | - rate_limiter, |
81 | | - symbols, |
82 | | - text, |
83 | | - timed, |
84 | | - timeout_after, |
85 | | -) |
86 | 96 |
|
87 | 97 | # Optional dependencies |
88 | 98 | try: |
|
0 commit comments