Skip to content

Commit

Permalink
Do not import from unpackaged paths in typing (#1926)
Browse files Browse the repository at this point in the history
The tests path is not part of the shipped project, thus this type cannot
be checked by users of this project.

The correct type in place of the type imported from tests appears to be
Optional[
    Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
]
  • Loading branch information
nakato committed Apr 26, 2021
1 parent 4faff23 commit 27ba783
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions github/Requester.pyi
Expand Up @@ -5,7 +5,6 @@ from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Union
from requests.models import Response

from github.GithubObject import GithubObject
from tests.Framework import ReplayingHttpsConnection

# from urllib3.util.retry import Retry

Expand Down Expand Up @@ -57,7 +56,9 @@ class Requester:
def __authenticate(
self, url: str, responseHeader: Dict[str, Any], parameters: Dict[str, Any],
) -> None: ...
def __customConnection(self, url: str,) -> Optional[ReplayingHttpsConnection]: ...
def __customConnection(
self, url: str,
) -> Optional[Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]]: ...
def __createConnection(
self,
) -> Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]: ...
Expand Down Expand Up @@ -120,7 +121,9 @@ class Requester:
parameters: Dict[str, str] = ...,
headers: Dict[str, str] = ...,
input: Optional[str] = ...,
cnx: Optional[ReplayingHttpsConnection] = ...,
cnx: Optional[
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
] = ...,
) -> Tuple[int, Dict[str, Any], str]: ...
def requestBlobAndCheck(
self,
Expand All @@ -137,7 +140,9 @@ class Requester:
parameters: Optional[Dict[str, Any]] = ...,
headers: Optional[Dict[str, Any]] = ...,
input: Optional[Any] = ...,
cnx: Optional[ReplayingHttpsConnection] = ...,
cnx: Optional[
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
] = ...,
) -> Tuple[int, Dict[str, Any], str]: ...
def requestJsonAndCheck(
self,
Expand All @@ -154,7 +159,9 @@ class Requester:
parameters: Optional[Dict[str, Any]] = ...,
headers: Optional[Dict[str, Any]] = ...,
input: Optional[OrderedDict] = ...,
cnx: Optional[ReplayingHttpsConnection] = ...,
cnx: Optional[
Union[HTTPRequestsConnectionClass, HTTPSRequestsConnectionClass]
] = ...,
) -> Tuple[int, Dict[str, Any], str]: ...
def requestMultipartAndCheck(
self,
Expand Down

0 comments on commit 27ba783

Please sign in to comment.