[mypy] Enable following imports for some directories (#6681)

This commit is contained in:
Cyrus Leung
2024-07-31 10:38:03 +08:00
committed by GitHub
parent c32ab8be1a
commit da1f7cc12a
18 changed files with 185 additions and 143 deletions
+5 -5
View File
@@ -1,19 +1,19 @@
from abc import abstractmethod
from abc import ABC, abstractmethod
from dataclasses import dataclass
@dataclass
class AdapterRequest:
class AdapterRequest(ABC):
"""
Base class for adapter requests.
"""
@property
@abstractmethod
def adapter_id(self):
...
def adapter_id(self) -> int:
raise NotImplementedError
def __post_init__(self):
def __post_init__(self) -> None:
if self.adapter_id < 1:
raise ValueError(f"id must be > 0, got {self.adapter_id}")