From a927592147fbb8936730f4d23dc2dcccc413f4f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 23:04:15 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20dependency=20ruff?= =?UTF-8?q?=20to=20v0.0.276=20(#232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ⬆️ Update dependency ruff to v0.0.276 * Change to list comprehension --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Klaas Schoute --- examples/disabled_parkings.py | 9 +++------ examples/garages.py | 6 ++---- poetry.lock | 38 +++++++++++++++++------------------ pyproject.toml | 2 +- src/liege/liege.py | 12 ++--------- 5 files changed, 27 insertions(+), 40 deletions(-) diff --git a/examples/disabled_parkings.py b/examples/disabled_parkings.py index 842b573..b931e81 100644 --- a/examples/disabled_parkings.py +++ b/examples/disabled_parkings.py @@ -11,15 +11,12 @@ async def main() -> None: async with ODPLiege() as client: disabled_parkings = await client.disabled_parkings(limit=5) - count: int - for index, item in enumerate(disabled_parkings, 1): - count = index + count: int = len(disabled_parkings) + for item in disabled_parkings: print(item) # Count unique id's in disabled_parkings - unique_values: list[str] = [] - for item in disabled_parkings: - unique_values.append(item.spot_id) + unique_values: list[str] = [str(item.spot_id) for item in disabled_parkings] num_values = len(set(unique_values)) print("__________________________") diff --git a/examples/garages.py b/examples/garages.py index fe392d4..48d4a51 100644 --- a/examples/garages.py +++ b/examples/garages.py @@ -10,11 +10,9 @@ async def main() -> None: """Get the garages data from Liège API.""" async with ODPLiege() as client: garages = await client.garages(limit=12) - print(garages) - count: int - for index, item in enumerate(garages, 1): - count = index + count: int = len(garages) + for item in garages: print(item) print("__________________________") diff --git a/poetry.lock b/poetry.lock index 97d781d..f4c177e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1172,28 +1172,28 @@ files = [ [[package]] name = "ruff" -version = "0.0.275" +version = "0.0.276" description = "An extremely fast Python linter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.0.275-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:5e6554a072e7ce81eb6f0bec1cebd3dcb0e358652c0f4900d7d630d61691e914"}, - {file = "ruff-0.0.275-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:1cc599022fe5ffb143a965b8d659eb64161ab8ab4433d208777eab018a1aab67"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5206fc1cd8c1c1deadd2e6360c0dbcd690f1c845da588ca9d32e4a764a402c60"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0c4e6468da26f77b90cae35319d310999f471a8c352998e9b39937a23750149e"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0dbdea02942131dbc15dd45f431d152224f15e1dd1859fcd0c0487b658f60f1a"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:22efd9f41af27ef8fb9779462c46c35c89134d33e326c889971e10b2eaf50c63"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2c09662112cfa22d7467a19252a546291fd0eae4f423e52b75a7a2000a1894db"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80043726662144876a381efaab88841c88e8df8baa69559f96b22d4fa216bef1"}, - {file = "ruff-0.0.275-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5859ee543b01b7eb67835dfd505faa8bb7cc1550f0295c92c1401b45b42be399"}, - {file = "ruff-0.0.275-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c8ace4d40a57b5ea3c16555f25a6b16bc5d8b2779ae1912ce2633543d4e9b1da"}, - {file = "ruff-0.0.275-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8347fc16aa185aae275906c4ac5b770e00c896b6a0acd5ba521f158801911998"}, - {file = "ruff-0.0.275-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ec43658c64bfda44fd84bbea9da8c7a3b34f65448192d1c4dd63e9f4e7abfdd4"}, - {file = "ruff-0.0.275-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:508b13f7ca37274cceaba4fb3ea5da6ca192356323d92acf39462337c33ad14e"}, - {file = "ruff-0.0.275-py3-none-win32.whl", hash = "sha256:6afb1c4422f24f361e877937e2a44b3f8176774a476f5e33845ebfe887dd5ec2"}, - {file = "ruff-0.0.275-py3-none-win_amd64.whl", hash = "sha256:d9b264d78621bf7b698b6755d4913ab52c19bd28bee1a16001f954d64c1a1220"}, - {file = "ruff-0.0.275-py3-none-win_arm64.whl", hash = "sha256:a19ce3bea71023eee5f0f089dde4a4272d088d5ac0b675867e074983238ccc65"}, - {file = "ruff-0.0.275.tar.gz", hash = "sha256:a63a0b645da699ae5c758fce19188e901b3033ec54d862d93fcd042addf7f38d"}, + {file = "ruff-0.0.276-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:c150912b8ebde843c10b33db90705d4fee48db6f05441e5d143be9f4c2f35df5"}, + {file = "ruff-0.0.276-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:5e9cd7238d34f24d7ccfadcce4dc6807b8c5a390f547dd7236d06488d9d6f40f"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc7dc557cc3fa2a03a88e99425ceee91429cc7432e5a41087850c1629294faed"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13e5983836ae383c04de213954da731f14ea884aaf74467abc47e1d79d8cf1b7"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4ac65df96be3e2f4b10bc97bbb624152281611b06ef1068d5bb064b7ad35d800"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d070a64de4affd17e006d6986ef25601dbbc6b373844ece5396c33900f8b8563"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2edcd6948a21fa7fb4594094da37a1aa1d205b7abaa718bd27d48ba1d7977348"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57c49b525d8ca3838d8b614f42e342077bed95aedd9fe6e6ec419f39320c214e"}, + {file = "ruff-0.0.276-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5980960a748ada3ddfe4ea7ff3a01b9113c456a14cb1a39b4c30783012d4cba6"}, + {file = "ruff-0.0.276-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:12be4f007114cf5ed1242e522762651539521ec32ae0210cc4b8dfe434a872f0"}, + {file = "ruff-0.0.276-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:6ed8fc729b3e7b9f20a4e2aa6f24c798b06912f8a94cb3e8fd590eba055780df"}, + {file = "ruff-0.0.276-py3-none-musllinux_1_2_i686.whl", hash = "sha256:735d724031212c2ab63fafdea49d4581ae866a1180d06c29b0b5481228ca6bb9"}, + {file = "ruff-0.0.276-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:100ad9055d50977c2b4ab3de0db62d6e525bcd4aafbb660a842733bdbf650be9"}, + {file = "ruff-0.0.276-py3-none-win32.whl", hash = "sha256:1b34a3673b2e5d97df8f7f04090c0b74e9ae6d3d172921d0e0781192954afddf"}, + {file = "ruff-0.0.276-py3-none-win_amd64.whl", hash = "sha256:02deadc0f6abead6cc2d38ddd7100a52aba27a0d90315facaa44b8b4acdba162"}, + {file = "ruff-0.0.276-py3-none-win_arm64.whl", hash = "sha256:a6bd5b53ac689a43c7afc45bd574a7b3efe0ceb192e26e95a055c770ef2045b9"}, + {file = "ruff-0.0.276.tar.gz", hash = "sha256:d456c86eb6ce9225507f24fcc7bf72fa031bb7cc750023310e62889bf4ad4b6a"}, ] [[package]] @@ -1468,4 +1468,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "d042916a98e043023d4601a993cbcdab63d42f8de7d925a45edeea7ca9e41c42" +content-hash = "b1667ab8ecbee61017e78811a92a201286f96a33cff11d23159182bdc6666616" diff --git a/pyproject.toml b/pyproject.toml index 9870fe9..a0eedff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ pytz = ">=2022.7.1,<2024.0.0" Changelog = "https://github.com/klaasnicolaas/python-liege/releases" [tool.poetry.group.dev.dependencies] -ruff = "0.0.275" +ruff = "0.0.276" aresponses = "2.1.6" black = "23.3.0" blacken-docs = "1.14.0" diff --git a/src/liege/liege.py b/src/liege/liege.py index 209e54f..d9f0fb3 100644 --- a/src/liege/liege.py +++ b/src/liege/liege.py @@ -110,15 +110,11 @@ async def disabled_parkings(self, limit: int = 10) -> list[DisabledParking]: ------- A list of DisabledParking objects. """ - results: list[DisabledParking] = [] locations = await self._request( "search/", params={"dataset": "stationnement-pmr", "rows": limit}, ) - - for item in locations["records"]: - results.append(DisabledParking.from_dict(item)) - return results + return [DisabledParking.from_dict(item) for item in locations["records"]] async def garages(self, limit: int = 10) -> list[Garage]: """Get list of parking garages. @@ -131,15 +127,11 @@ async def garages(self, limit: int = 10) -> list[Garage]: ------- A list of Garage objects. """ - results: list[Garage] = [] locations = await self._request( "search/", params={"dataset": "parkings-voitures-hors-voirie", "rows": limit}, ) - - for item in locations["records"]: - results.append(Garage.from_dict(item)) - return results + return [Garage.from_dict(item) for item in locations["records"]] async def close(self) -> None: """Close open client session."""