Skip to content

Commit 925b5a2

Browse files
committed
fix types for extras
1 parent 2cdc1e9 commit 925b5a2

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

lite_bootstrap/bootstrappers/fastapi_bootstrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def bootstrap(self) -> None:
110110
)
111111

112112

113-
class FastAPIBootstrapper(BaseBootstrapper[fastapi.FastAPI]):
113+
class FastAPIBootstrapper(BaseBootstrapper["fastapi.FastAPI"]):
114114
__slots__ = "bootstrap_config", "instruments"
115115

116116
instruments_types: typing.ClassVar = [

lite_bootstrap/bootstrappers/faststream_bootstrapper.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import dataclasses
32
import json
43
import typing
@@ -53,8 +52,8 @@ def __call__(self, msg: typing.Any | None) -> faststream.BaseMiddleware: ... #
5352

5453
@dataclasses.dataclass(kw_only=True, slots=True, frozen=True)
5554
class FastStreamConfig(HealthChecksConfig, LoggingConfig, OpentelemetryConfig, PrometheusConfig, SentryConfig):
56-
application: AsgiFastStream = dataclasses.field(default_factory=AsgiFastStream)
57-
broker: BrokerUsecase[typing.Any, typing.Any] | None = None
55+
application: "AsgiFastStream" = dataclasses.field(default_factory=AsgiFastStream)
56+
broker: typing.Optional["BrokerUsecase[typing.Any, typing.Any]"] = None
5857
opentelemetry_middleware_cls: type[FastStreamTelemetryMiddlewareProtocol] | None = None
5958
prometheus_middleware_cls: type[FastStreamPrometheusMiddlewareProtocol] | None = None
6059

@@ -65,7 +64,7 @@ class FastStreamHealthChecksInstrument(HealthChecksInstrument):
6564

6665
def bootstrap(self) -> None:
6766
@handle_get
68-
async def check_health(_: object) -> AsgiResponse:
67+
async def check_health(_: object) -> "AsgiResponse":
6968
return (
7069
AsgiResponse(
7170
json.dumps(self.render_health_check_data()).encode(), 200, headers={"content-type": "text/plain"}
@@ -137,7 +136,7 @@ def bootstrap(self) -> None:
137136
)
138137

139138

140-
class FastStreamBootstrapper(BaseBootstrapper[AsgiFastStream]):
139+
class FastStreamBootstrapper(BaseBootstrapper["AsgiFastStream"]):
141140
__slots__ = "bootstrap_config", "instruments"
142141

143142
instruments_types: typing.ClassVar = [
@@ -158,5 +157,5 @@ def __init__(self, bootstrap_config: FastStreamConfig) -> None:
158157
if self.bootstrap_config.broker:
159158
self.bootstrap_config.application.broker = self.bootstrap_config.broker
160159

161-
def _prepare_application(self) -> AsgiFastStream:
160+
def _prepare_application(self) -> "AsgiFastStream":
162161
return self.bootstrap_config.application

lite_bootstrap/bootstrappers/litestar_bootstrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class LitestarPrometheusController(PrometheusController):
112112
self.bootstrap_config.application_config.middleware.append(litestar_prometheus_config.middleware)
113113

114114

115-
class LitestarBootstrapper(BaseBootstrapper[litestar.Litestar]):
115+
class LitestarBootstrapper(BaseBootstrapper["litestar.Litestar"]):
116116
__slots__ = "bootstrap_config", "instruments"
117117

118118
instruments_types: typing.ClassVar = [
@@ -131,5 +131,5 @@ def is_ready(self) -> bool:
131131
def __init__(self, bootstrap_config: LitestarConfig) -> None:
132132
super().__init__(bootstrap_config)
133133

134-
def _prepare_application(self) -> litestar.Litestar:
134+
def _prepare_application(self) -> "litestar.Litestar":
135135
return litestar.Litestar.from_config(self.bootstrap_config.application_config)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ python_version = "3.10"
132132
strict = true
133133

134134
[tool.ruff]
135-
fix = true
135+
fix = false
136136
unsafe-fixes = true
137137
line-length = 120
138138
target-version = "py310"

0 commit comments

Comments
 (0)