Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/hatch/index/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import hyperlink

from hatch._version import __version__

if TYPE_CHECKING:
import httpx

Expand Down Expand Up @@ -47,11 +49,19 @@ def __init__(self, repo: str, *, user='', auth='', ca_cert=None, client_cert=Non

@cached_property
def client(self) -> httpx.Client:
import platform

import httpx

from hatch.utils.network import DEFAULT_TIMEOUT

user_agent = (
f'Hatch/{__version__} '
f'{platform.python_implementation()}/{platform.python_version()} '
f'HTTPX/{httpx.__version__}'
)
return httpx.Client(
headers={'User-Agent': user_agent},
transport=httpx.HTTPTransport(retries=3, verify=self.__verify, cert=self.__cert),
timeout=DEFAULT_TIMEOUT,
)
Expand Down