Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions conjure_python_client/_http/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from dataclasses import dataclass, field
from typing import List, Optional

import requests


@dataclass
class SslConfiguration:
Expand All @@ -24,6 +26,7 @@ class SslConfiguration:
class ServiceConfiguration:
api_token: Optional[str] = None
security: Optional[SslConfiguration] = None
session: Optional[requests.Session] = None
uris: List[str] = field(default_factory=list)
connect_timeout: float = 10
read_timeout: float = 300
Expand Down
7 changes: 4 additions & 3 deletions conjure_python_client/_http/requests_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ def create(
backoff_factor=float(service_config.backoff_slot_size) / 1000,
)
transport_adapter = TransportAdapter(max_retries=retry)
# create a session, for shared connection polling, user agent, etc
session = requests.Session()
session.headers = CaseInsensitiveDict({"User-Agent": user_agent})
# create a session if one was not provided
if service_config.session is None:
session = requests.Session()
session.headers.update(CaseInsensitiveDict({"User-Agent": user_agent}))
if service_config.security is not None:
verify = service_config.security.trust_store_path
else:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def blackCheck(self):
# The project's main homepage.
url="https://github.com/palantir/conjure-python-client",
author="Palantir Technologies, Inc.",
classifiers=[
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
"Programming Language :: Python :: 3.10",
],
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
Expand Down