Update ruff to 0.9 (#1482)
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run

Ruff 0.9 contains a number of formatter changes for the 2025 style guide.
Update to `ruff>=0.9.0` and apply the formatter fixes.
https://astral.sh/blog/ruff-v0.9.0
This commit is contained in:
Steven B.
2025-01-24 10:53:27 +00:00
committed by GitHub
parent 09fce3f426
commit 9b7bf367ae
16 changed files with 44 additions and 53 deletions

View File

@@ -218,9 +218,9 @@ class FakeSmartCamTransport(BaseTransport):
@staticmethod
def _get_second_key(request_dict: dict[str, Any]) -> str:
assert (
len(request_dict) == 2
), f"Unexpected dict {request_dict}, should be length 2"
assert len(request_dict) == 2, (
f"Unexpected dict {request_dict}, should be length 2"
)
it = iter(request_dict)
next(it, None)
return next(it)

View File

@@ -223,9 +223,9 @@ async def test_update_module_update_delays(
now if mod_delay == 0 else now - (seconds % mod_delay)
)
assert (
module._last_update_time == expected_update_time
), f"Expected update time {expected_update_time} after {seconds} seconds for {module.name} with delay {mod_delay} got {module._last_update_time}"
assert module._last_update_time == expected_update_time, (
f"Expected update time {expected_update_time} after {seconds} seconds for {module.name} with delay {mod_delay} got {module._last_update_time}"
)
async def _get_child_responses(child_requests: list[dict[str, Any]], child_protocol):

View File

@@ -653,8 +653,7 @@ async def test_light_preset(dev: Device, runner: CliRunner):
if len(light_preset.preset_states_list) == 0:
pytest.skip(
"Some fixtures do not have presets and"
" the api doesn'tsupport creating them"
"Some fixtures do not have presets and the api doesn'tsupport creating them"
)
# Start off with a known state
first_name = light_preset.preset_list[1]

View File

@@ -56,7 +56,7 @@ def test_encrypt():
status_parameters = pytest.mark.parametrize(
"status_code, error_code, inner_error_code, expectation",
("status_code", "error_code", "inner_error_code", "expectation"),
[
(200, 0, 0, does_not_raise()),
(400, 0, 0, pytest.raises(KasaException)),

View File

@@ -273,7 +273,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
)
msg = f"{host} responded with an unexpected " f"status code 401 to handshake1"
msg = f"{host} responded with an unexpected status code 401 to handshake1"
with pytest.raises(KasaException, match=msg):
await transport.send(json_dumps(request))
@@ -288,7 +288,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
)
msg = f"{host} responded with an unexpected " f"status code 401 to login"
msg = f"{host} responded with an unexpected status code 401 to login"
with pytest.raises(KasaException, match=msg):
await transport.send(json_dumps(request))
@@ -303,7 +303,7 @@ async def test_unencrypted_passthrough_errors(mocker, caplog, want_default):
aiohttp.ClientSession, "post", side_effect=mock_ssl_aes_device.post
)
msg = f"{host} responded with an unexpected " f"status code 401 to unencrypted send"
msg = f"{host} responded with an unexpected status code 401 to unencrypted send"
with pytest.raises(KasaException, match=msg):
await transport.send(json_dumps(request))