|
@@ -46,7 +46,18 @@ import select
|
|
|
import socket
|
|
|
import subprocess
|
|
|
import sys
|
|
|
-from typing import Any, Callable, Dict, List, Optional, Set, Tuple, IO
|
|
|
+from typing import (
|
|
|
+ Any,
|
|
|
+ Callable,
|
|
|
+ Dict,
|
|
|
+ List,
|
|
|
+ Optional,
|
|
|
+ Set,
|
|
|
+ Tuple,
|
|
|
+ IO,
|
|
|
+ Union,
|
|
|
+ TYPE_CHECKING,
|
|
|
+)
|
|
|
|
|
|
from urllib.parse import (
|
|
|
quote as urlquote,
|
|
@@ -57,6 +68,9 @@ from urllib.parse import (
|
|
|
urlunparse,
|
|
|
)
|
|
|
|
|
|
+if TYPE_CHECKING:
|
|
|
+ import urllib3
|
|
|
+
|
|
|
|
|
|
import dulwich
|
|
|
from dulwich.config import get_xdg_config_home_path, Config, apply_instead_of
|
|
@@ -437,7 +451,6 @@ class _v1ReceivePackHeader(object):
|
|
|
"""Handle the head of a 'git-receive-pack' request.
|
|
|
|
|
|
Args:
|
|
|
- proto: Protocol object to read from
|
|
|
capabilities: List of negotiated capabilities
|
|
|
old_refs: Old refs, as received from the server
|
|
|
new_refs: Refs to change
|
|
@@ -1782,8 +1795,8 @@ def default_user_agent_string():
|
|
|
|
|
|
def default_urllib3_manager( # noqa: C901
|
|
|
config, pool_manager_cls=None, proxy_manager_cls=None, **override_kwargs
|
|
|
-):
|
|
|
- """Return `urllib3` connection pool manager.
|
|
|
+) -> Union["urllib3.ProxyManager", "urllib3.PoolManager"]:
|
|
|
+ """Return urllib3 connection pool manager.
|
|
|
|
|
|
Honour detected proxy configurations.
|
|
|
|
|
@@ -1792,9 +1805,9 @@ def default_urllib3_manager( # noqa: C901
|
|
|
override_kwargs: Additional arguments for `urllib3.ProxyManager`
|
|
|
|
|
|
Returns:
|
|
|
- `pool_manager_cls` (defaults to `urllib3.ProxyManager`) instance for
|
|
|
- proxy configurations, `proxy_manager_cls` (defaults to
|
|
|
- `urllib3.PoolManager`) instance otherwise.
|
|
|
+ Either pool_manager_cls (defaults to `urllib3.ProxyManager`) instance for
|
|
|
+ proxy configurations, proxy_manager_cls
|
|
|
+ (defaults to `urllib3.PoolManager`) instance otherwise
|
|
|
|
|
|
"""
|
|
|
proxy_server = user_agent = None
|
|
@@ -1894,9 +1907,9 @@ class AbstractHttpGitClient(GitClient):
|
|
|
data: Request data.
|
|
|
|
|
|
Returns:
|
|
|
- Tuple (`response`, `read`), where response is an `urllib3`
|
|
|
- response object with additional `content_type` and
|
|
|
- `redirect_location` properties, and `read` is a consumable read
|
|
|
+ Tuple (response, read), where response is an urllib3
|
|
|
+ response object with additional content_type and
|
|
|
+ redirect_location properties, and read is a consumable read
|
|
|
method for the response data.
|
|
|
|
|
|
"""
|