@@ -139,17 +139,13 @@ def __post_init__(self) -> None:
139139
140140
141141@dataclasses .dataclass (kw_only = True , slots = True )
142- class LitestarCorsInstrument (CorsInstrument ):
143- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
144-
142+ class LitestarCorsInstrument (CorsInstrument [LitestarConfig ]):
145143 def bootstrap (self ) -> None :
146144 self .bootstrap_config .application_config .cors_config = CORSConfig (** self .cors_kwargs )
147145
148146
149147@dataclasses .dataclass (kw_only = True , slots = True )
150- class LitestarHealthChecksInstrument (HealthChecksInstrument ):
151- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
152-
148+ class LitestarHealthChecksInstrument (HealthChecksInstrument [LitestarConfig ]):
153149 def build_litestar_health_check_router (self ) -> "litestar.Router" :
154150 @litestar .get (media_type = litestar .MediaType .JSON )
155151 async def health_check_handler () -> HealthCheckTypedDict :
@@ -167,9 +163,7 @@ def bootstrap(self) -> None:
167163
168164
169165@dataclasses .dataclass (kw_only = True )
170- class LitestarLoggingInstrument (LoggingInstrument ):
171- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
172-
166+ class LitestarLoggingInstrument (LoggingInstrument [LitestarConfig ]):
173167 def _build_logging_middleware_excluded_paths (self ) -> list [str ]:
174168 """Regex-escaped path prefixes for infrastructure routes not worth an access log line."""
175169 # Litestar matches exclude patterns with an unanchored search, so anchor each one to the
@@ -209,8 +203,7 @@ def _configure_structlog_loggers(self) -> None:
209203
210204
211205@dataclasses .dataclass (kw_only = True )
212- class LitestarOpenTelemetryInstrument (OpenTelemetryInstrument ):
213- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
206+ class LitestarOpenTelemetryInstrument (OpenTelemetryInstrument [LitestarConfig ]):
214207 missing_dependency_message = "opentelemetry-instrumentation-asgi or litestar>=2.22 is not installed"
215208
216209 @staticmethod
@@ -251,8 +244,7 @@ def bootstrap(self) -> None:
251244
252245
253246@dataclasses .dataclass (kw_only = True )
254- class LitestarPrometheusInstrument (PrometheusInstrument ):
255- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
247+ class LitestarPrometheusInstrument (PrometheusInstrument [LitestarConfig ]):
256248 missing_dependency_message = "prometheus_client is not installed"
257249
258250 @staticmethod
@@ -279,12 +271,11 @@ class LitestarPrometheusController(PrometheusController):
279271
280272
281273@dataclasses .dataclass (kw_only = True )
282- class LitestarSwaggerInstrument (SwaggerInstrument ):
283- bootstrap_config : LitestarConfig # ty: ignore[invalid-mutable-override]
274+ class LitestarSwaggerInstrument (SwaggerInstrument [LitestarConfig ]):
284275 not_configured_reason = "swagger_path is empty or not valid"
285276
286277 @classmethod
287- def is_configured (cls , bootstrap_config : "LitestarConfig" ) -> bool : # ty: ignore[invalid-method-override]
278+ def is_configured (cls , bootstrap_config : "LitestarConfig" ) -> bool :
288279 return bool (bootstrap_config .swagger_path ) and is_valid_path (bootstrap_config .swagger_path )
289280
290281 def bootstrap (self ) -> None :
0 commit comments