Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lite_bootstrap/bootstrappers/fastapi_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def send_wrapper(message: "Message") -> None:

@dataclasses.dataclass(kw_only=True)
class FastAPILoggingInstrument(LoggingInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
super().bootstrap()
Expand All @@ -167,15 +167,15 @@ def bootstrap(self) -> None:

@dataclasses.dataclass(kw_only=True, slots=True)
class FastAPICorsInstrument(CorsInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
self.bootstrap_config.app.add_middleware(CORSMiddleware, **self.cors_kwargs)


@dataclasses.dataclass(kw_only=True, slots=True)
class FastAPIHealthChecksInstrument(HealthChecksInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]

def build_fastapi_health_check_router(self) -> "fastapi.APIRouter":
fastapi_router = fastapi.APIRouter(
Expand All @@ -195,7 +195,7 @@ def bootstrap(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastAPIOpenTelemetryInstrument(OpenTelemetryInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
super().bootstrap()
Expand All @@ -214,7 +214,7 @@ def teardown(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastAPIPrometheusInstrument(PrometheusInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]
missing_dependency_message = "prometheus_fastapi_instrumentator is not installed"

@staticmethod
Expand All @@ -237,7 +237,7 @@ def bootstrap(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastAPISwaggerInstrument(SwaggerInstrument):
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
config = self.bootstrap_config
Expand All @@ -261,7 +261,7 @@ class FastAPIBootstrapper(BaseBootstrapper["fastapi.FastAPI"]):
FastAPIPrometheusInstrument,
FastAPISwaggerInstrument,
]
bootstrap_config: FastAPIConfig
bootstrap_config: FastAPIConfig # ty: ignore[invalid-mutable-override]
not_ready_message = "fastapi is not installed"

@contextlib.asynccontextmanager
Expand Down
10 changes: 5 additions & 5 deletions lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class FastMcpConfig(

@dataclasses.dataclass(kw_only=True)
class FastMcpHealthChecksInstrument(HealthChecksInstrument):
bootstrap_config: FastMcpConfig
bootstrap_config: FastMcpConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
config = self.bootstrap_config
Expand All @@ -217,7 +217,7 @@ async def health_check_handler(_: "Request") -> "JSONResponse":

@dataclasses.dataclass(kw_only=True)
class FastMcpOpenTelemetryInstrument(OpenTelemetryInstrument):
bootstrap_config: FastMcpConfig
bootstrap_config: FastMcpConfig # ty: ignore[invalid-mutable-override]
missing_dependency_message = "opentelemetry-instrumentation-asgi is not installed"
_restore_http_app: typing.Callable[[], None] | None = dataclasses.field(
default=None, init=False, repr=False, compare=False
Expand Down Expand Up @@ -258,7 +258,7 @@ def teardown(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastMcpPrometheusInstrument(PrometheusInstrument):
bootstrap_config: FastMcpConfig
bootstrap_config: FastMcpConfig # ty: ignore[invalid-mutable-override]
missing_dependency_message = "prometheus_client or prometheus_fastapi_instrumentator is not installed"
_restore_http_app: typing.Callable[[], None] | None = dataclasses.field(
default=None, init=False, repr=False, compare=False
Expand Down Expand Up @@ -320,7 +320,7 @@ def teardown(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastMcpLoggingInstrument(LoggingInstrument):
bootstrap_config: FastMcpConfig
bootstrap_config: FastMcpConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
super().bootstrap()
Expand All @@ -340,7 +340,7 @@ class FastMcpBootstrapper(BaseBootstrapper["FastMCP[typing.Any]"]):
FastMcpLoggingInstrument,
FastMcpPrometheusInstrument,
]
bootstrap_config: FastMcpConfig
bootstrap_config: FastMcpConfig # ty: ignore[invalid-mutable-override]
not_ready_message = "fastmcp is not installed"

def is_ready(self) -> bool:
Expand Down
10 changes: 5 additions & 5 deletions lite_bootstrap/bootstrappers/faststream_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FastStreamConfig(

@dataclasses.dataclass(kw_only=True, slots=True)
class FastStreamHealthChecksInstrument(HealthChecksInstrument):
bootstrap_config: FastStreamConfig
bootstrap_config: FastStreamConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
config = self.bootstrap_config
Expand Down Expand Up @@ -114,7 +114,7 @@ async def _define_health_status(self) -> bool:

@dataclasses.dataclass(kw_only=True)
class FastStreamLoggingInstrument(LoggingInstrument):
bootstrap_config: FastStreamConfig
bootstrap_config: FastStreamConfig # ty: ignore[invalid-mutable-override]
_prior_broker_params_storage: typing.Any = dataclasses.field(default=None, init=False, repr=False, compare=False)
_broker_logger_replaced: bool = dataclasses.field(default=False, init=False, repr=False, compare=False)

Expand Down Expand Up @@ -142,7 +142,7 @@ def teardown(self) -> None:

@dataclasses.dataclass(kw_only=True)
class FastStreamOpenTelemetryInstrument(OpenTelemetryInstrument):
bootstrap_config: FastStreamConfig
bootstrap_config: FastStreamConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
super().bootstrap()
Expand All @@ -161,7 +161,7 @@ def _make_collector_registry() -> "prometheus_client.CollectorRegistry":

@dataclasses.dataclass(kw_only=True)
class FastStreamPrometheusInstrument(PrometheusInstrument):
bootstrap_config: FastStreamConfig
bootstrap_config: FastStreamConfig # ty: ignore[invalid-mutable-override]
collector_registry: "prometheus_client.CollectorRegistry" = dataclasses.field(init=False)
not_configured_reason = (
PrometheusInstrument.not_configured_reason
Expand Down Expand Up @@ -204,7 +204,7 @@ class FastStreamBootstrapper(BaseBootstrapper["AsgiFastStream"]):
FastStreamLoggingInstrument,
FastStreamPrometheusInstrument,
]
bootstrap_config: FastStreamConfig
bootstrap_config: FastStreamConfig # ty: ignore[invalid-mutable-override]
not_ready_message = "faststream is not installed"

def is_ready(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion lite_bootstrap/bootstrappers/free_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FreeBootstrapper(BaseBootstrapper[None]):
OpenTelemetryInstrument,
PyroscopeInstrument,
]
bootstrap_config: FreeConfig
bootstrap_config: FreeConfig # ty: ignore[invalid-mutable-override]
not_ready_message = ""

def is_ready(self) -> bool:
Expand Down
14 changes: 7 additions & 7 deletions lite_bootstrap/bootstrappers/litestar_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def __post_init__(self) -> None:

@dataclasses.dataclass(kw_only=True, slots=True)
class LitestarCorsInstrument(CorsInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]

def bootstrap(self) -> None:
self.bootstrap_config.application_config.cors_config = CORSConfig(**self.cors_kwargs)


@dataclasses.dataclass(kw_only=True, slots=True)
class LitestarHealthChecksInstrument(HealthChecksInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]

def build_litestar_health_check_router(self) -> "litestar.Router":
@litestar.get(media_type=litestar.MediaType.JSON)
Expand All @@ -168,7 +168,7 @@ def bootstrap(self) -> None:

@dataclasses.dataclass(kw_only=True)
class LitestarLoggingInstrument(LoggingInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]

def _build_logging_middleware_excluded_paths(self) -> list[str]:
"""Regex-escaped path prefixes for infrastructure routes not worth an access log line."""
Expand Down Expand Up @@ -210,7 +210,7 @@ def _configure_structlog_loggers(self) -> None:

@dataclasses.dataclass(kw_only=True)
class LitestarOpenTelemetryInstrument(OpenTelemetryInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]
missing_dependency_message = "opentelemetry-instrumentation-asgi or litestar>=2.22 is not installed"

@staticmethod
Expand Down Expand Up @@ -252,7 +252,7 @@ def bootstrap(self) -> None:

@dataclasses.dataclass(kw_only=True)
class LitestarPrometheusInstrument(PrometheusInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]
missing_dependency_message = "prometheus_client is not installed"

@staticmethod
Expand Down Expand Up @@ -280,7 +280,7 @@ class LitestarPrometheusController(PrometheusController):

@dataclasses.dataclass(kw_only=True)
class LitestarSwaggerInstrument(SwaggerInstrument):
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]
not_configured_reason = "swagger_path is empty or not valid"

@classmethod
Expand Down Expand Up @@ -328,7 +328,7 @@ class LitestarBootstrapper(BaseBootstrapper["litestar.Litestar"]):
LitestarPrometheusInstrument,
LitestarSwaggerInstrument,
]
bootstrap_config: LitestarConfig
bootstrap_config: LitestarConfig # ty: ignore[invalid-mutable-override]
not_ready_message = "litestar is not installed"

def __init__(self, bootstrap_config: LitestarConfig) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ lint = [
]

[build-system]
requires = ["uv_build<0.12"]
requires = ["uv_build>=0.11,<1.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
Expand Down
Loading