Skip to content

Commit 73069b6

Browse files
authored
Bump pre-commit ruff to 0.11.10 (#5904)
Bump pre-commit ruff to 0.11.10 and address current issues.
1 parent 8251b6c commit 73069b6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.1
3+
rev: v0.11.10
44
hooks:
55
- id: ruff
66
args:

supervisor/coresys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _load_machine_id() -> str | None:
167167
@property
168168
def dev(self) -> bool:
169169
"""Return True if we run dev mode."""
170-
return bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
170+
return bool(os.environ.get(ENV_SUPERVISOR_DEV) == "1")
171171

172172
@property
173173
def timezone(self) -> str:

supervisor/docker/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def support_cpu_realtime(self) -> bool:
8383
"""Return true, if CONFIG_RT_GROUP_SCHED is loaded."""
8484
if not Path("/sys/fs/cgroup/cpu/cpu.rt_runtime_us").exists():
8585
return False
86-
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT, 0))
86+
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT) == "1")
8787

8888

8989
class DockerConfig(FileConfiguration):
@@ -202,7 +202,7 @@ def run(
202202
if "labels" not in kwargs:
203203
kwargs["labels"] = {}
204204
elif isinstance(kwargs["labels"], list):
205-
kwargs["labels"] = {label: "" for label in kwargs["labels"]}
205+
kwargs["labels"] = dict.fromkeys(kwargs["labels"], "")
206206

207207
kwargs["labels"][LABEL_MANAGED] = ""
208208

tests/misc/test_filter_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_not_supported(coresys):
103103
def test_is_dev(coresys):
104104
"""Test if dev."""
105105
coresys.config.diagnostics = True
106-
with patch("os.environ", return_value=[("ENV_SUPERVISOR_DEV", "1")]):
106+
with patch.dict(os.environ, {"SUPERVISOR_DEV": "1"}):
107107
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
108108

109109

0 commit comments

Comments
 (0)