From 623955b0290dd50f4c6a3ff5bddd5d2be0d79903 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Mon, 10 Jan 2022 20:47:23 +0100 Subject: [PATCH 1/2] Add retry and poolsize to typing --- github/MainClass.pyi | 5 +++-- github/Requester.pyi | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/github/MainClass.pyi b/github/MainClass.pyi index a757e9e28b..bb45b6f71d 100644 --- a/github/MainClass.pyi +++ b/github/MainClass.pyi @@ -22,7 +22,7 @@ from github.RateLimit import RateLimit from github.Repository import Repository from github.Topic import Topic -# from urllib3.util.retry import Retry +from urllib3.util.retry import Retry TGithubObject = TypeVar("TGithubObject", bound=GithubObject) @@ -39,7 +39,8 @@ class Github: user_agent: str = ..., per_page: int = ..., verify: bool = ..., - retry: Any = ..., + retry: Optional[Union[int, Retry]] = ..., + pool_size: Optional[int] = ..., ) -> None: ... @property def FIX_REPO_GET_GIT_REF(self) -> bool: ... diff --git a/github/Requester.pyi b/github/Requester.pyi index f97220c136..082816102e 100644 --- a/github/Requester.pyi +++ b/github/Requester.pyi @@ -6,7 +6,7 @@ from requests.models import Response from github.GithubObject import GithubObject -# from urllib3.util.retry import Retry +from urllib3.util.retry import Retry class HTTPRequestsConnectionClass: def __init__( @@ -15,7 +15,8 @@ class HTTPRequestsConnectionClass: port: Optional[int] = ..., strict: bool = ..., timeout: Optional[int] = ..., - retry: Any = ..., + retry: Optional[Union[int, Retry]] = ..., + pool_size: Optional[int] = ..., **kwargs: str ) -> None: ... def close(self) -> None: ... @@ -31,7 +32,8 @@ class HTTPSRequestsConnectionClass: port: Optional[int] = ..., strict: bool = ..., timeout: Optional[int] = ..., - retry: Any = ..., + retry: Optional[Union[int, Retry]] = ..., + pool_size: Optional[int] = ..., **kwargs: str ) -> None: ... def close(self) -> None: ... @@ -120,7 +122,8 @@ class Requester: user_agent: str, per_page: int, verify: bool, - retry: Any, + retry: Optional[Union[int, Retry]], + pool_size: Optional[int], ) -> None: ... def _initializeDebugFeature(self) -> None: ... def check_me(self, obj: GithubObject) -> None: ... From 4530f40eb5cc49cd736dd04da0e9623fa4c63ba1 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Mon, 10 Jan 2022 20:59:24 +0100 Subject: [PATCH 2/2] Align import with MainClass.py --- github/MainClass.pyi | 2 +- github/Requester.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/github/MainClass.pyi b/github/MainClass.pyi index bb45b6f71d..62b84e238a 100644 --- a/github/MainClass.pyi +++ b/github/MainClass.pyi @@ -22,7 +22,7 @@ from github.RateLimit import RateLimit from github.Repository import Repository from github.Topic import Topic -from urllib3.util.retry import Retry +from urllib3.util import Retry TGithubObject = TypeVar("TGithubObject", bound=GithubObject) diff --git a/github/Requester.pyi b/github/Requester.pyi index 082816102e..381fae929b 100644 --- a/github/Requester.pyi +++ b/github/Requester.pyi @@ -6,7 +6,7 @@ from requests.models import Response from github.GithubObject import GithubObject -from urllib3.util.retry import Retry +from urllib3.util import Retry class HTTPRequestsConnectionClass: def __init__(