Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update dependency ruff to v0.2.1 #361

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This extend our general Ruff rules specifically for the examples
extend = "../pyproject.toml"

extend-ignore = [
lint.extend-ignore = [
"T201", # Allow the use of print() in examples
]
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.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pytz = "^2023.3"
Changelog = "https://github.com/klaasnicolaas/python-odp-gent/releases"

[tool.poetry.group.dev.dependencies]
ruff = "0.1.14"
ruff = "0.2.1"
aresponses = "3.0.0"
blacken-docs = "1.16.0"
codespell = "2.2.6"
Expand Down Expand Up @@ -130,8 +130,8 @@ addopts = "--cov"
asyncio_mode = "auto"

[tool.ruff]
select = ["ALL"]
ignore = [
lint.select = ["ALL"]
lint.ignore = [
"ANN101", # Self... explanatory
"ANN401", # Opinioated warning on disallowing dynamically typed expressions
"D203", # Conflicts with other rules
Expand All @@ -152,14 +152,14 @@ ignore = [
"W191",
]

[tool.ruff.flake8-pytest-style]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
fixture-parentheses = false

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["odp_gent"]

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 25

[build-system]
Expand Down
6 changes: 6 additions & 0 deletions src/odp_gent/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def from_dict(cls: type[Garage], data: dict[str, Any]) -> Garage:
Returns:
-------
A Garage object.

"""
attr = data["fields"]
geo = data["geometry"]["coordinates"]
Expand Down Expand Up @@ -104,6 +105,7 @@ def from_dict(cls: type[ParkAndRide], data: dict[str, Any]) -> ParkAndRide:
Returns:
-------
A ParkAndRide object.

"""

def convert_bool(value: str) -> bool:
Expand All @@ -116,6 +118,7 @@ def convert_bool(value: str) -> bool:
Returns:
-------
A boolean.

"""
if value == "True":
return True
Expand Down Expand Up @@ -172,6 +175,7 @@ def from_dict(cls: type[BlueBike], data: dict[str, Any]) -> BlueBike:
Returns:
-------
A BlueBike object.

"""
attr = data["fields"]
return cls(
Expand Down Expand Up @@ -213,6 +217,7 @@ def from_dict(cls: type[Partago], data: dict[str, Any]) -> Partago:
Returns:
-------
A Partago object.

"""
attr = data["fields"]
geo = data["geometry"]["coordinates"]
Expand Down Expand Up @@ -251,6 +256,7 @@ def from_dict(cls: type[Vehicle], data: dict[str, Any]) -> Vehicle:
Returns:
-------
A Vehicle object.

"""
return cls(
brand=data["brand"],
Expand Down
7 changes: 7 additions & 0 deletions src/odp_gent/odp_gent.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def _request(
ODPGentConnectionError: Timeout occurred while
connecting to the Open Data Platform API.
ODPGentError: If the data is not valid.

"""
version = metadata.version(__package__)
url = URL.build(
Expand Down Expand Up @@ -104,6 +105,7 @@ async def garages(self, limit: int = 10) -> list[Garage]:
Returns:
-------
A list of Garage objects.

"""
locations = await self._request(
"search/",
Expand All @@ -126,6 +128,7 @@ async def park_and_rides(
Returns:
-------
A list of ParkAndRide objects.

"""
params: dict[str, Any] = {
"dataset": "real-time-bezetting-pr-gent",
Expand All @@ -146,6 +149,7 @@ async def bluebikes(self) -> list[BlueBike]:
Returns
-------
A list of BlueBike objects.

"""
# Data is spread over multiple datasets
datasets: list[str] = [
Expand All @@ -172,6 +176,7 @@ async def partago_vehicles(self, limit: int = 10) -> list[Partago]:
Returns
-------
A list of Partago objects.

"""
vehicles = await self._request(
"search/",
Expand All @@ -190,6 +195,7 @@ async def __aenter__(self) -> Self:
Returns
-------
The Open Data Platform Gent object.

"""
return self

Expand All @@ -199,5 +205,6 @@ async def __aexit__(self, *_exc_info: object) -> None:
Args:
----
_exc_info: Exec type.

"""
await self.close()
4 changes: 2 additions & 2 deletions tests/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This extend our general Ruff rules specifically for tests
extend = "../pyproject.toml"

extend-select = [
lint.extend-select = [
"PT", # Use @pytest.fixture without parentheses
]

extend-ignore = [
lint.extend-ignore = [
"S101", # Use of assert detected. As these are tests...
"SLF001", # Tests will access private/protected members...
"TCH002", # pytest doesn't like this one...
Expand Down
Loading