From 1c2905809386201805b619f5508301a0e6841a42 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Wed, 14 Oct 2026 17:04:50 +0300 Subject: [PATCH] fix: silence ty 0.0.87 override checks on instrument bootstrap_config --- .../bootstrappers/fastapi_bootstrapper.py | 14 +++++++------- .../bootstrappers/fastmcp_bootstrapper.py | 10 +++++----- .../bootstrappers/faststream_bootstrapper.py | 10 +++++----- lite_bootstrap/bootstrappers/free_bootstrapper.py | 2 +- .../bootstrappers/litestar_bootstrapper.py | 14 +++++++------- pyproject.toml | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lite_bootstrap/bootstrappers/fastapi_bootstrapper.py b/lite_bootstrap/bootstrappers/fastapi_bootstrapper.py index 9dc3b6f..a307b6d 100644 --- a/lite_bootstrap/bootstrappers/fastapi_bootstrapper.py +++ b/lite_bootstrap/bootstrappers/fastapi_bootstrapper.py @@ -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() @@ -167,7 +167,7 @@ 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) @@ -175,7 +175,7 @@ def bootstrap(self) -> None: @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( @@ -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() @@ -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 @@ -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 @@ -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 diff --git a/lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py b/lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py index ef263ec..4851f2a 100644 --- a/lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py +++ b/lite_bootstrap/bootstrappers/fastmcp_bootstrapper.py @@ -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 @@ -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 @@ -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 @@ -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() @@ -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: diff --git a/lite_bootstrap/bootstrappers/faststream_bootstrapper.py b/lite_bootstrap/bootstrappers/faststream_bootstrapper.py index d4054e8..1b7b167 100644 --- a/lite_bootstrap/bootstrappers/faststream_bootstrapper.py +++ b/lite_bootstrap/bootstrappers/faststream_bootstrapper.py @@ -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 @@ -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) @@ -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() @@ -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 @@ -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: diff --git a/lite_bootstrap/bootstrappers/free_bootstrapper.py b/lite_bootstrap/bootstrappers/free_bootstrapper.py index 065b906..4e76bbe 100644 --- a/lite_bootstrap/bootstrappers/free_bootstrapper.py +++ b/lite_bootstrap/bootstrappers/free_bootstrapper.py @@ -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: diff --git a/lite_bootstrap/bootstrappers/litestar_bootstrapper.py b/lite_bootstrap/bootstrappers/litestar_bootstrapper.py index 5417afa..83d7293 100644 --- a/lite_bootstrap/bootstrappers/litestar_bootstrapper.py +++ b/lite_bootstrap/bootstrappers/litestar_bootstrapper.py @@ -140,7 +140,7 @@ 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) @@ -148,7 +148,7 @@ def bootstrap(self) -> None: @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) @@ -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.""" @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/pyproject.toml b/pyproject.toml index f9cb844..91cbd6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]