Skip to content

Commit 8a3da7d

Browse files
committed
Enable ruff PYI rule and fix type annotation violations
- Use Self return type for __aenter__ (PYI034) - Simplify int | float to float in type hints (PYI041)
1 parent 825b6b7 commit 8a3da7d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

pyoverkiz/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import urllib.parse
88
from pathlib import Path
99
from types import TracebackType
10-
from typing import Any, cast
10+
from typing import Any, Self, cast
1111

1212
import backoff
1313
from aiohttp import (
@@ -218,7 +218,7 @@ def __init__(
218218
ssl_context=self._ssl,
219219
)
220220

221-
async def __aenter__(self) -> OverkizClient:
221+
async def __aenter__(self) -> Self:
222222
"""Enter async context manager and return the client instance."""
223223
return self
224224

pyoverkiz/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,8 @@ class ValuePrototype:
12731273
def __init__(
12741274
self,
12751275
type: str,
1276-
min_value: int | float | None = None,
1277-
max_value: int | float | None = None,
1276+
min_value: float | None = None,
1277+
max_value: float | None = None,
12781278
enum_values: list[str] | None = None,
12791279
description: str | None = None,
12801280
**_: Any,

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ select = [
7373
"C4",
7474
# pep8-naming
7575
"N",
76+
# flake8-pyi
77+
"PYI",
7678
]
7779
ignore = ["E501"] # Line too long
7880

0 commit comments

Comments
 (0)