From 537974663fbf44767d53acd813dfd5cb58c4f2a3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:13:59 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency=20?= =?UTF-8?q?ruff=20to=20v0.1.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- poetry.lock | 38 +++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index 802f54c1..8f167ecd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1650,28 +1650,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.14" +version = "0.1.15" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:96f76536df9b26622755c12ed8680f159817be2f725c17ed9305b472a757cdbb"}, - {file = "ruff-0.1.14-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ab3f71f64498c7241123bb5a768544cf42821d2a537f894b22457a543d3ca7a9"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7060156ecc572b8f984fd20fd8b0fcb692dd5d837b7606e968334ab7ff0090ab"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a53d8e35313d7b67eb3db15a66c08434809107659226a90dcd7acb2afa55faea"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bea9be712b8f5b4ebed40e1949379cfb2a7d907f42921cf9ab3aae07e6fba9eb"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2270504d629a0b064247983cbc495bed277f372fb9eaba41e5cf51f7ba705a6a"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80258bb3b8909b1700610dfabef7876423eed1bc930fe177c71c414921898efa"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:653230dd00aaf449eb5ff25d10a6e03bc3006813e2cb99799e568f55482e5cae"}, - {file = "ruff-0.1.14-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87b3acc6c4e6928459ba9eb7459dd4f0c4bf266a053c863d72a44c33246bfdbf"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6b3dadc9522d0eccc060699a9816e8127b27addbb4697fc0c08611e4e6aeb8b5"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1c8eca1a47b4150dc0fbec7fe68fc91c695aed798532a18dbb1424e61e9b721f"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_i686.whl", hash = "sha256:62ce2ae46303ee896fc6811f63d6dabf8d9c389da0f3e3f2bce8bc7f15ef5488"}, - {file = "ruff-0.1.14-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b2027dde79d217b211d725fc833e8965dc90a16d0d3213f1298f97465956661b"}, - {file = "ruff-0.1.14-py3-none-win32.whl", hash = "sha256:722bafc299145575a63bbd6b5069cb643eaa62546a5b6398f82b3e4403329cab"}, - {file = "ruff-0.1.14-py3-none-win_amd64.whl", hash = "sha256:e3d241aa61f92b0805a7082bd89a9990826448e4d0398f0e2bc8f05c75c63d99"}, - {file = "ruff-0.1.14-py3-none-win_arm64.whl", hash = "sha256:269302b31ade4cde6cf6f9dd58ea593773a37ed3f7b97e793c8594b262466b67"}, - {file = "ruff-0.1.14.tar.gz", hash = "sha256:ad3f8088b2dfd884820289a06ab718cde7d38b94972212cc4ba90d5fbc9955f3"}, + {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:5fe8d54df166ecc24106db7dd6a68d44852d14eb0729ea4672bb4d96c320b7df"}, + {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f0bfbb53c4b4de117ac4d6ddfd33aa5fc31beeaa21d23c45c6dd249faf9126f"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0d432aec35bfc0d800d4f70eba26e23a352386be3a6cf157083d18f6f5881c8"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9405fa9ac0e97f35aaddf185a1be194a589424b8713e3b97b762336ec79ff807"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c66ec24fe36841636e814b8f90f572a8c0cb0e54d8b5c2d0e300d28a0d7bffec"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6f8ad828f01e8dd32cc58bc28375150171d198491fc901f6f98d2a39ba8e3ff5"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86811954eec63e9ea162af0ffa9f8d09088bab51b7438e8b6488b9401863c25e"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd4025ac5e87d9b80e1f300207eb2fd099ff8200fa2320d7dc066a3f4622dc6b"}, + {file = "ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b17b93c02cdb6aeb696effecea1095ac93f3884a49a554a9afa76bb125c114c1"}, + {file = "ruff-0.1.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ddb87643be40f034e97e97f5bc2ef7ce39de20e34608f3f829db727a93fb82c5"}, + {file = "ruff-0.1.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:abf4822129ed3a5ce54383d5f0e964e7fef74a41e48eb1dfad404151efc130a2"}, + {file = "ruff-0.1.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6c629cf64bacfd136c07c78ac10a54578ec9d1bd2a9d395efbee0935868bf852"}, + {file = "ruff-0.1.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1bab866aafb53da39c2cadfb8e1c4550ac5340bb40300083eb8967ba25481447"}, + {file = "ruff-0.1.15-py3-none-win32.whl", hash = "sha256:2417e1cb6e2068389b07e6fa74c306b2810fe3ee3476d5b8a96616633f40d14f"}, + {file = "ruff-0.1.15-py3-none-win_amd64.whl", hash = "sha256:3837ac73d869efc4182d9036b1405ef4c73d9b1f88da2413875e34e0d6919587"}, + {file = "ruff-0.1.15-py3-none-win_arm64.whl", hash = "sha256:9a933dfb1c14ec7a33cceb1e49ec4a16b51ce3c20fd42663198746efc0427360"}, + {file = "ruff-0.1.15.tar.gz", hash = "sha256:f6dfa8c1b21c913c326919056c390966648b680966febcb796cc9d1aaab8564e"}, ] [[package]] @@ -1969,4 +1969,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "2b084ffb5ae9509ff4ac6b49a44d0ac11b457de66785f358e083c27ff573e225" +content-hash = "ec03d49d456c921c212c8de781ccbe4f18cefb870834ec8e8849d7717d266863" diff --git a/pyproject.toml b/pyproject.toml index 9e988f42..3eaad511 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ pylint = "3.0.3" pytest = "7.4.4" pytest-asyncio = "0.23.4" pytest-cov = "4.1.0" -ruff = "0.1.14" +ruff = "0.1.15" safety = "3.0.1" syrupy = "4.6.0" types-cachetools = "5.3.0.7" From 01fa8491d13d99d58c13c654db05dc4aa1ebabf8 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 1 Feb 2024 12:56:41 +0100 Subject: [PATCH 2/2] Run ruff --- src/radios/models.py | 3 +++ src/radios/radio_browser.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/radios/models.py b/src/radios/models.py index be18a316..616e964d 100644 --- a/src/radios/models.py +++ b/src/radios/models.py @@ -102,6 +102,7 @@ def country(self) -> str | None: Returns ------- Country name or None if no country code is set. + """ if resolved_country := pycountry.countries.get(alpha_2=self.country_code): return cast(str, resolved_country.name) @@ -123,6 +124,7 @@ def favicon(self) -> str: Returns ------- URL to the favicon. + """ return f"https://flagcdn.com/256x192/{self.code.lower()}.png" @@ -142,6 +144,7 @@ def favicon(self) -> str | None: Returns ------- URL to the favicon. + """ if self.code: return f"https://flagcdn.com/256x192/{self.code.lower()}.png" diff --git a/src/radios/radio_browser.py b/src/radios/radio_browser.py index ed7478e9..2f01f536 100644 --- a/src/radios/radio_browser.py +++ b/src/radios/radio_browser.py @@ -68,6 +68,7 @@ async def _request( with the Radio Browser API. RadioBrowserError: Received an unexpected response from the Radio Browser API. + """ if self._host is None: resolver = DNSResolver() @@ -119,6 +120,7 @@ async def stats(self) -> Stats: Returns ------- A Stats object, with information about the Radio Browser API. + """ response = await self._request("stats") return Stats.from_json(response) @@ -134,6 +136,7 @@ async def station_click(self, *, uuid: str) -> None: Args: ---- uuid: UUID of the station. + """ await self._request(f"url/{uuid}") @@ -160,6 +163,7 @@ async def countries( # noqa: PLR0913 Returns: ------- A Stats object, with information about the Radio Browser API. + """ countries_data = await self._request( "countrycodes", @@ -210,6 +214,7 @@ async def languages( # noqa: PLR0913 Returns: ------- A list of Language objects. + """ languages_data = await self._request( "languages", @@ -273,6 +278,7 @@ async def search( # noqa: PLR0913 Returns: ------- A list of Station objects. + """ uri = "stations/search" if filter_by is not None: @@ -312,6 +318,7 @@ async def station(self, *, uuid: str) -> Station | None: Returns: ------- A Station object if found. + """ stations = await self.stations( filter_by=FilterBy.UUID, @@ -349,6 +356,7 @@ async def stations( # noqa: PLR0913 Returns: ------- A list of Station objects. + """ uri = "stations" if filter_by is not None: @@ -392,6 +400,7 @@ async def tags( # noqa: PLR0913 Returns: ------- A list of Tags objects. + """ tags_data = await self._request( "tags", @@ -417,6 +426,7 @@ async def __aenter__(self) -> Self: Returns ------- The RadioBrowser object. + """ return self @@ -426,5 +436,6 @@ async def __aexit__(self, *_exc_info: object) -> None: Args: ---- _exc_info: Exec type. + """ await self.close()