From cbb3259211d47de5204a657dec46c30c6dec80b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 08:15:52 +0100 Subject: [PATCH] Bump ruff from 0.5.5 to 0.7.2 (#734) * Bump ruff from 0.5.5 to 0.7.2 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.5 to 0.7.2. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.5.5...0.7.2) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Disable ASYNC109 in tests * Adjust for ICN001 in voice.py * Ignore ASYNC110 on line 294 in remote.py --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ludeeus --- hass_nabucasa/remote.py | 2 +- hass_nabucasa/voice.py | 8 ++++---- pyproject.toml | 2 +- tests/ruff.toml | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hass_nabucasa/remote.py b/hass_nabucasa/remote.py index 2c5ab82bb..46fb9d6d9 100644 --- a/hass_nabucasa/remote.py +++ b/hass_nabucasa/remote.py @@ -291,7 +291,7 @@ async def load_backend(self) -> bool: _LOGGER.debug("Waiting for aiohttp runner to come available") # aiohttp_runner comes available when Home Assistant has started. - while self.cloud.client.aiohttp_runner is None: + while self.cloud.client.aiohttp_runner is None: # noqa: ASYNC110 await asyncio.sleep(1) try: diff --git a/hass_nabucasa/voice.py b/hass_nabucasa/voice.py index e71c6712a..bc1c14aec 100644 --- a/hass_nabucasa/voice.py +++ b/hass_nabucasa/voice.py @@ -7,7 +7,7 @@ from enum import Enum import logging from typing import TYPE_CHECKING -from xml.etree import ElementTree +from xml.etree import ElementTree as ET from aiohttp.hdrs import ACCEPT, AUTHORIZATION, CONTENT_TYPE, USER_AGENT import attr @@ -1323,9 +1323,9 @@ async def process_tts( await self._update_token() # SSML - xml_body = ElementTree.Element("speak", version="1.0") + xml_body = ET.Element("speak", version="1.0") xml_body.set("{http://www.w3.org/XML/1998/namespace}lang", language) - voice_el = ElementTree.SubElement(xml_body, "voice") + voice_el = ET.SubElement(xml_body, "voice") voice_el.set("{http://www.w3.org/XML/1998/namespace}lang", language) voice_el.set( "name", @@ -1350,7 +1350,7 @@ async def process_tts( "X-Microsoft-OutputFormat": output_header, USER_AGENT: self.cloud.client.client_name, }, - data=ElementTree.tostring(xml_body), + data=ET.tostring(xml_body), ) as resp: if resp.status == 429 and not force_token_renewal: # By checking the force_token_renewal argument, we limit retries to 1. diff --git a/pyproject.toml b/pyproject.toml index 614a79b50..76af61128 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ test = [ "pytest-aiohttp==1.0.5", "pytest-timeout==2.3.1", "pytest==8.3.3", - "ruff==0.5.5", + "ruff==0.7.2", "types_atomicwrites==1.4.5.1", "types_pyOpenSSL==24.1.0.20240722", "xmltodict==0.14.2", diff --git a/tests/ruff.toml b/tests/ruff.toml index 74b8cc843..ed29ca986 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -11,6 +11,7 @@ ignore = [ "ANN003", "ANN201", "ANN202", + "ASYNC109", "ASYNC230", "PT004", "PT006",