Skip to content

Commit

Permalink
⬆️ Update dependency ruff to v0.0.276 (#232)
Browse files Browse the repository at this point in the history
* ⬆️ 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 <[email protected]>
  • Loading branch information
renovate[bot] and klaasnicolaas committed Jul 4, 2023
1 parent 65a2f09 commit a927592
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 40 deletions.
9 changes: 3 additions & 6 deletions examples/disabled_parkings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("__________________________")
Expand Down
6 changes: 2 additions & 4 deletions examples/garages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("__________________________")
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 2 additions & 10 deletions src/liege/liege.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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."""
Expand Down

0 comments on commit a927592

Please sign in to comment.