Enable more ruff checks in deltachat-rpc-client

This commit is contained in:
link2xt
2023-02-21 11:17:10 +00:00
parent f07206bd6c
commit 05a274a5f3
11 changed files with 53 additions and 20 deletions

View File

@@ -1,15 +1,15 @@
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._utils import AttrDict
from .chat import Chat
from .const import ChatlistFlag, ContactFlag, SpecialContactId
from .contact import Contact
from .message import Message
from .rpc import Rpc
if TYPE_CHECKING:
from .deltachat import DeltaChat
from .rpc import Rpc
@dataclass

View File

@@ -1,16 +1,17 @@
import calendar
from datetime import datetime
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
from ._utils import AttrDict
from .const import ChatVisibility
from .contact import Contact
from .message import Message
from .rpc import Rpc
if TYPE_CHECKING:
from datetime import datetime
from .account import Account
from .rpc import Rpc
@dataclass

View File

@@ -2,6 +2,7 @@
import inspect
import logging
from typing import (
TYPE_CHECKING,
Callable,
Coroutine,
Dict,
@@ -13,8 +14,6 @@ from typing import (
Union,
)
from deltachat_rpc_client.account import Account
from ._utils import (
AttrDict,
parse_system_add_remove,
@@ -31,6 +30,9 @@ from .events import (
RawEvent,
)
if TYPE_CHECKING:
from deltachat_rpc_client.account import Account
class Client:
"""Simple Delta Chat client that listen to events of a single account."""

View File

@@ -1,12 +1,12 @@
from typing import TYPE_CHECKING
from dataclasses import dataclass
from typing import TYPE_CHECKING
from ._utils import AttrDict
from .rpc import Rpc
if TYPE_CHECKING:
from .account import Account
from .chat import Chat
from .rpc import Rpc
@dataclass

View File

@@ -1,8 +1,10 @@
from typing import Dict, List
from typing import TYPE_CHECKING, Dict, List
from ._utils import AttrDict
from .account import Account
from .rpc import Rpc
if TYPE_CHECKING:
from .rpc import Rpc
class DeltaChat:

View File

@@ -2,11 +2,13 @@
import inspect
import re
from abc import ABC, abstractmethod
from typing import Callable, Iterable, Iterator, Optional, Set, Tuple, Union
from typing import TYPE_CHECKING, Callable, Iterable, Iterator, Optional, Set, Tuple, Union
from ._utils import AttrDict
from .const import EventType
if TYPE_CHECKING:
from ._utils import AttrDict
def _tuple_of(obj, type_: type) -> tuple:
if not obj:

View File

@@ -1,13 +1,13 @@
import json
from typing import TYPE_CHECKING, Union
from dataclasses import dataclass
from typing import TYPE_CHECKING, Union
from ._utils import AttrDict
from .contact import Contact
from .rpc import Rpc
if TYPE_CHECKING:
from .account import Account
from .rpc import Rpc
@dataclass

View File

@@ -1,8 +1,8 @@
import asyncio
import json
import os
from typing import AsyncGenerator, List, Optional
import asyncio
import aiohttp
import pytest_asyncio