|
22 | 22 | import uwtools.api |
23 | 23 | import uwtools.api.config |
24 | 24 | import uwtools.api.driver |
25 | | -import uwtools.api.ecflow |
26 | 25 | import uwtools.api.execute |
27 | 26 | import uwtools.api.fs |
28 | 27 | import uwtools.api.rocoto |
|
42 | 41 | if TYPE_CHECKING: |
43 | 42 | from iotaa import Node |
44 | 43 |
|
| 44 | +_ECFLOW_AVAILABLE = True |
| 45 | +try: |
| 46 | + import uwtools.api.ecflow |
| 47 | +except ImportError: |
| 48 | + _ECFLOW_AVAILABLE = False |
| 49 | + |
| 50 | + |
45 | 51 | DRIVERS = [ |
46 | 52 | STR.cdeps, |
47 | 53 | STR.chgres_cube, |
@@ -111,8 +117,9 @@ def main() -> None: |
111 | 117 | STR.fs: _dispatch_fs, |
112 | 118 | STR.rocoto: _dispatch_rocoto, |
113 | 119 | STR.template: _dispatch_template, |
114 | | - STR.ecflow: _dispatch_ecflow, |
115 | 120 | } |
| 121 | + if _ECFLOW_AVAILABLE: |
| 122 | + tools[STR.ecflow] = _dispatch_ecflow |
116 | 123 | drivers: dict[str, Callable[..., bool]] = { |
117 | 124 | x: partial(_dispatch_to_driver, x) for x in DRIVERS |
118 | 125 | } |
@@ -1565,12 +1572,13 @@ def _parse_args(raw_args: list[str]) -> tuple[Args, Checks]: |
1565 | 1572 | subparsers = _add_subparsers(parser, STR.mode, STR.mode.upper()) |
1566 | 1573 | tools = { |
1567 | 1574 | STR.config: partial(_add_subparser_config, subparsers), |
1568 | | - STR.ecflow: partial(_add_subparser_ecflow, subparsers), |
1569 | 1575 | STR.execute: partial(_add_subparser_execute, subparsers), |
1570 | 1576 | STR.fs: partial(_add_subparser_fs, subparsers), |
1571 | 1577 | STR.rocoto: partial(_add_subparser_rocoto, subparsers), |
1572 | 1578 | STR.template: partial(_add_subparser_template, subparsers), |
1573 | 1579 | } |
| 1580 | + if _ECFLOW_AVAILABLE: |
| 1581 | + tools[STR.ecflow] = partial(_add_subparser_ecflow, subparsers) |
1574 | 1582 | no_components: list[str] = [] |
1575 | 1583 | assets = { |
1576 | 1584 | component: partial(_add_subparser_for_driver, component, subparsers) |
|
0 commit comments