Bump pre-commit ruff to 0.11.10 (#5904)

Bump pre-commit ruff to 0.11.10 and address current issues.
This commit is contained in:
Stefan Agner 2025-05-21 15:06:32 +02:00 committed by GitHub
parent 8251b6c61c
commit 73069b628e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
rev: v0.11.10
hooks:
- id: ruff
args:

View File

@ -167,7 +167,7 @@ class CoreSys:
@property
def dev(self) -> bool:
"""Return True if we run dev mode."""
return bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
return bool(os.environ.get(ENV_SUPERVISOR_DEV) == "1")
@property
def timezone(self) -> str:

View File

@ -83,7 +83,7 @@ class DockerInfo:
"""Return true, if CONFIG_RT_GROUP_SCHED is loaded."""
if not Path("/sys/fs/cgroup/cpu/cpu.rt_runtime_us").exists():
return False
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT, 0))
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT) == "1")
class DockerConfig(FileConfiguration):
@ -202,7 +202,7 @@ class DockerAPI:
if "labels" not in kwargs:
kwargs["labels"] = {}
elif isinstance(kwargs["labels"], list):
kwargs["labels"] = {label: "" for label in kwargs["labels"]}
kwargs["labels"] = dict.fromkeys(kwargs["labels"], "")
kwargs["labels"][LABEL_MANAGED] = ""

View File

@ -103,7 +103,7 @@ def test_not_supported(coresys):
def test_is_dev(coresys):
"""Test if dev."""
coresys.config.diagnostics = True
with patch("os.environ", return_value=[("ENV_SUPERVISOR_DEV", "1")]):
with patch.dict(os.environ, {"SUPERVISOR_DEV": "1"}):
assert filter_data(coresys, SAMPLE_EVENT, {}) is None