-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add(bot,web_api): setup types stubs for some ignored libraries
Added basic type stubs for some of the smaller libraries the bot and web_api use. Libraries with missing types that remain: - structlog, waiting on the release of its typed api - requests_async, need to convert to httpx which has types - asyncio_redis, maybe write stubs, or use a different client - django, stubs exist, last time we tried it, there were a number of false positives - stripe, no types currently, could probably write some minimal stubs rel: stripe/stripe-python#650
- Loading branch information
Showing
9 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from re import Match, RegexFlag | ||
from typing import AnyStr, Optional, Pattern, overload | ||
|
||
_FlagsType = RegexFlag | ||
@overload | ||
def search( | ||
pattern: AnyStr, string: AnyStr, flags: _FlagsType = ... | ||
) -> Optional[Match[AnyStr]]: ... | ||
@overload | ||
def search( | ||
pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ... | ||
) -> Optional[Match[AnyStr]]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ZstdCompressor: | ||
def compress(self, arg: object) -> bytes: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Optional | ||
|
||
from typing_extensions import TypedDict | ||
|
||
class DBConfig(TypedDict): | ||
NAME: str | ||
USER: str | ||
PASSWORD: str | ||
HOST: str | ||
PORT: str | ||
CONN_MAX_AGE: int | ||
ENGINE: str | ||
|
||
def parse( | ||
url: str, | ||
engine: Optional[str] = None, | ||
conn_max_age: int = 0, | ||
ssl_require: bool = False, | ||
) -> DBConfig: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any, Mapping, Optional | ||
|
||
from typing_extensions import Literal | ||
|
||
class RequestsMock: | ||
def __enter__(self) -> RequestsMock: ... | ||
def __exit__(self, type: object, value: object, traceback: object) -> bool: ... | ||
def add( | ||
self, | ||
method: Optional[Literal["GET", "POST"]] = None, | ||
url: Optional[str] = None, | ||
body: str = "", | ||
adding_headers: Optional[Mapping[str, str]] = None, | ||
json: Optional[Mapping[str, Any]] = None, | ||
status: Optional[int] = None, | ||
content_type: Optional[str] = None, | ||
) -> None: ... | ||
|
||
GET: Literal["GET"] | ||
POST: Literal["POST"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ZstdDecompressor: | ||
def decompress(self, data: bytes) -> bytes: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters