From 86188385cbdae1ee90c1dca7a7b9db2edef1ecd4 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 19 Sep 2026 14:24:13 +0200 Subject: style: ruff's own fixes, mechanically applied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ruff check .` had gone unrun long enough to report 568 errors, which is the same as having no linter: the next real finding would have been invisible in the noise. This is the 521 it fixes by itself, in 173 files, and nothing else — the 98 it cannot fix are the next commit. What actually changed: import sorting (225), imports nobody used (87, none of them a re-export — no `__init__.py` is touched, which was the one way this could have broken an import elsewhere), `datetime.timezone.utc` to `datetime.UTC` (69) and `asyncio.TimeoutError` to `TimeoutError` (18), both plain aliases on the 3.12 this project requires, `Optional[X]` to `X | None` (24), and f-strings with nothing to interpolate (19). Checked rather than assumed: every module in the three packages still imports, and the suite is 2893 passed — the same count, test for test, as the merge before it. Co-Authored-By: Claude Opus 5 --- packages/meshbay-node/tests/test_node_status.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'packages/meshbay-node/tests/test_node_status.py') diff --git a/packages/meshbay-node/tests/test_node_status.py b/packages/meshbay-node/tests/test_node_status.py index 897be33..7a27623 100644 --- a/packages/meshbay-node/tests/test_node_status.py +++ b/packages/meshbay-node/tests/test_node_status.py @@ -12,22 +12,22 @@ from pathlib import Path import pytest from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey - -from conftest import one_root from meshbay_common.adminop import ( - OP_ROOT_ADD, OP_ROOT_REMOVE, OP_GROUP_ATTACH, OP_MEMBER_UNPIN, + OP_MEMBER_UNPIN, admin_transcript, ) -from meshbay_node.transport.quic_server import Denylist from meshbay_common.crypto import pk_to_b64 from meshbay_common.join import ROLE_OPERATOR from meshbay_common.protocol import MNP from meshbay_node import ops from meshbay_node.indexer.group_index import GroupIndex -from meshbay_node.roster import open_roster from meshbay_node.roots import RootSet +from meshbay_node.roster import open_roster +from meshbay_node.transport.quic_server import Denylist from meshbay_node.transport.webrtc_server import WebRTCPeerSession +from conftest import one_root + GROUP = "g" * 32 @@ -260,7 +260,7 @@ async def test_add_root_creates_directory_and_returns_info(tmp_path): shared.mkdir() new_dir = tmp_path / "new_root" - from meshbay_node.config import NodeConfig, GroupConfig, RootSpec + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(shared), name="shared", kind="generic", writable=True), ]) @@ -300,7 +300,7 @@ async def test_remove_root_requires_at_least_one_remaining(tmp_path): shared = tmp_path / "shared" shared.mkdir() - from meshbay_node.config import GroupConfig, RootSpec, NodeConfig + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(shared), name="shared", kind="generic", writable=True), ]) @@ -333,7 +333,7 @@ async def test_removing_a_writable_root_is_allowed(tmp_path): d1.mkdir() d2.mkdir() - from meshbay_node.config import GroupConfig, RootSpec, NodeConfig + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(d1), name="incoming", kind="generic", writable=True), RootSpec(path=str(d2), name="shared", kind="generic", writable=False), @@ -369,7 +369,7 @@ async def test_update_root_rewrites_the_flags_in_node_toml(tmp_path): d1 = tmp_path / "media" d1.mkdir() - from meshbay_node.config import GroupConfig, RootSpec, NodeConfig + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(d1), name="media", kind="generic", writable=False), ]) @@ -420,7 +420,7 @@ async def test_update_root_replaces_a_legacy_upload_line(tmp_path): d1 = tmp_path / "media" d1.mkdir() - from meshbay_node.config import GroupConfig, RootSpec, NodeConfig + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(d1), name="media", kind="generic", writable=True), ]) @@ -452,7 +452,7 @@ async def test_remove_root_succeeds_with_two_roots(tmp_path): d1.mkdir() d2.mkdir() - from meshbay_node.config import GroupConfig, RootSpec, NodeConfig + from meshbay_node.config import GroupConfig, NodeConfig, RootSpec cfg = GroupConfig(id=GROUP, name="test", roots=[ RootSpec(path=str(d1), name="dir1", kind="generic", writable=True), RootSpec(path=str(d2), name="dir2", kind="generic", writable=False), -- cgit v1.2.3