Skip to content

Commit e0c4466

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 ValuePrototype (PYI041)
1 parent 4650dbd commit e0c4466

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 (
@@ -216,7 +216,7 @@ def __init__(
216216
ssl_context=self._ssl,
217217
)
218218

219-
async def __aenter__(self) -> OverkizClient:
219+
async def __aenter__(self) -> Self:
220220
"""Enter async context manager and return the client instance."""
221221
return self
222222

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
@@ -116,6 +116,8 @@ select = [
116116
"PIE",
117117
# eradicate
118118
"ERA",
119+
# flake8-pyi
120+
"PYI",
119121
]
120122
ignore = [
121123
"E501", # Line too long

0 commit comments

Comments
 (0)