Skip to content

Commit

Permalink
Update the code for Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Aug 14, 2023
1 parent bfabcbb commit 5bce5de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/disabled_parkings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pylint: disable=W0621
"""Asynchronous Python client providing Open Data information of Liège."""
from __future__ import annotations

import asyncio

Expand Down
9 changes: 6 additions & 3 deletions src/liege/liege.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import socket
from dataclasses import dataclass
from importlib import metadata
from typing import Any
from typing import TYPE_CHECKING, Any

import aiohttp
import async_timeout
Expand All @@ -15,6 +15,9 @@
from .exceptions import ODPLiegeConnectionError, ODPLiegeError
from .models import DisabledParking, Garage

if TYPE_CHECKING:
from typing_extensions import Self


@dataclass
class ODPLiege:
Expand Down Expand Up @@ -138,7 +141,7 @@ async def close(self) -> None:
if self.session and self._close_session:
await self.session.close()

async def __aenter__(self) -> ODPLiege:
async def __aenter__(self) -> Self:
"""Async enter.
Returns
Expand All @@ -147,7 +150,7 @@ async def __aenter__(self) -> ODPLiege:
"""
return self

async def __aexit__(self, *_exc_info: Any) -> None:
async def __aexit__(self, *_exc_info: object) -> None:
"""Async exit.
Args:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Test the models."""
from __future__ import annotations

import aiohttp
import pytest
from aresponses import ResponsesMockServer
Expand Down

0 comments on commit 5bce5de

Please sign in to comment.