|
9 | 9 | InstrumentDependencyMissingWarning, |
10 | 10 | collect_teardown_errors, |
11 | 11 | ) |
12 | | -from lite_bootstrap.instruments.base import BaseConfig, BaseInstrument |
| 12 | +from lite_bootstrap.instruments.base import BaseInstrument, ConfigT |
13 | 13 | from lite_bootstrap.types import ApplicationT |
14 | 14 |
|
15 | 15 |
|
|
19 | 19 | InstrumentT = typing.TypeVar("InstrumentT", bound=BaseInstrument) |
20 | 20 |
|
21 | 21 |
|
22 | | -class BaseBootstrapper(abc.ABC, typing.Generic[ApplicationT]): |
| 22 | +class BaseBootstrapper(abc.ABC, typing.Generic[ApplicationT, ConfigT]): |
23 | 23 | instruments_types: typing.ClassVar[list[type[BaseInstrument]]] |
24 | 24 | not_ready_message: typing.ClassVar[str] |
25 | 25 | instruments: list[BaseInstrument] |
26 | 26 | skipped_instruments: list[tuple[type[BaseInstrument], str]] |
27 | | - bootstrap_config: BaseConfig |
| 27 | + bootstrap_config: ConfigT |
28 | 28 | _application: ApplicationT |
29 | 29 |
|
30 | 30 | # Marker tagged on a user-supplied app (or its config) once this bootstrapper has |
31 | 31 | # attached its teardown to the framework's shutdown lifecycle. Prevents a second |
32 | 32 | # bootstrapper on the same app from re-attaching. Its accepted limits: ADR-0003. |
33 | 33 | _TEARDOWN_MARKER: typing.ClassVar[str] = "_lite_bootstrap_teardown_attached" |
34 | 34 |
|
35 | | - def __init__(self, bootstrap_config: BaseConfig) -> None: |
| 35 | + def __init__(self, bootstrap_config: ConfigT) -> None: |
36 | 36 | self.is_bootstrapped = False |
37 | 37 | self._torn_down = False |
38 | 38 | # Set when another bootstrapper already owns this application; bootstrap() then refuses. |
|
0 commit comments