Increase ruff coverage (#23644)
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / Jetson Jetpack 6 (push) Waiting to run

* Pin ruff

* Add python upgrade fixes

This enables python upgrade checks in ruff to look for deprecated types and patterns. This namely fixes:
- usage of deprecated `Typing` which is now built in
- some specific exceptions which are caught and have new aliases

Some specific UP checks were also ignored as they are stylistic / unimportant and likely to cause bugs

* Remove async blocking calls

Use asyncio.to_thread on two remaining blocking calls to fix hanging event thread loop. Enable this specific rule to block it in the future.

* Use proper logging mechanism

* Correctly format logs

* Raise with context

When raising an exception include the from context to improve debugging

* Cleanup
This commit is contained in:
Nicolas Mowen
2026-07-06 12:28:02 -05:00
committed by GitHub
parent 455b8687e8
commit 4ee12e6237
169 changed files with 1053 additions and 1150 deletions
+7 -8
View File
@@ -1,7 +1,6 @@
from typing import Optional
from typing import Self
from pydantic import Field, ValidationInfo, model_validator
from typing_extensions import Self
from frigate.const import FREQUENCY_STATS_POINTS
@@ -43,33 +42,33 @@ class MqttConfig(FrigateBaseModel):
title="Stats interval",
description="Interval in seconds for publishing system and camera stats to MQTT.",
)
user: Optional[EnvString] = Field(
user: EnvString | None = Field(
default=None,
title="MQTT username",
description="Optional MQTT username; can be provided via environment variables or secrets.",
)
password: Optional[EnvString] = Field(
password: EnvString | None = Field(
default=None,
title="MQTT password",
description="Optional MQTT password; can be provided via environment variables or secrets.",
validate_default=True,
)
tls_ca_certs: Optional[str] = Field(
tls_ca_certs: str | None = Field(
default=None,
title="TLS CA certs",
description="Path to CA certificate for TLS connections to the broker (for self-signed certs).",
)
tls_client_cert: Optional[str] = Field(
tls_client_cert: str | None = Field(
default=None,
title="Client cert",
description="Client certificate path for TLS mutual authentication; do not set user/password when using client certs.",
)
tls_client_key: Optional[str] = Field(
tls_client_key: str | None = Field(
default=None,
title="Client key",
description="Private key path for the client certificate.",
)
tls_insecure: Optional[bool] = Field(
tls_insecure: bool | None = Field(
default=None,
title="TLS insecure",
description="Allow insecure TLS connections by skipping hostname verification (not recommended).",