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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
10 changes: 6 additions & 4 deletions apiclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

LOG = logging.getLogger(__name__)

# Timeout in seconds (float)
DEFAULT_TIMEOUT = 10.0


class APIClient:
def __init__(
Expand All @@ -28,6 +25,7 @@ def __init__(
self._default_headers = {}
self._default_query_params = {}
self._default_username_password_authentication = None
self._default_timeout = 10.0
# A session needs to live at this client level so that all
# request strategies have access to the same session.
self._session = None
Expand Down Expand Up @@ -105,7 +103,11 @@ def get_default_username_password_authentication(self) -> Optional[tuple]:

def get_request_timeout(self) -> float:
"""Return the number of seconds before the request times out."""
return DEFAULT_TIMEOUT
return self._default_timeout

def set_request_timeout(self, timeout):
"""Return the number of seconds before the request times out."""
self._default_timeout = timeout

def clone(self):
"""Enable Prototype pattern on client."""
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import setuptools

# Pinning tenacity as the api has changed slightly which breaks all tests.
application_dependencies = ["requests>=2.16", "tenacity>=5.1.0"]
application_dependencies = ["requests>=2.31.0", "tenacity>=5.1.0"]
prod_dependencies = []
test_dependencies = ["pytest", "pytest-env", "pytest-cov", "vcrpy", "requests-mock"]
lint_dependencies = ["flake8", "flake8-docstrings", "black", "isort"]
Expand All @@ -21,7 +21,7 @@


setuptools.setup(
name="api-client",
name="apiclient",
version=version,
description="Separate the high level client implementation from the underlying CRUD.",
long_description=long_description,
Expand All @@ -30,10 +30,10 @@
author_email="",
url="https://github.com/MikeWooster/api-client",
python_requires=">=3.6",
packages=["apiclient"],
packages=["apiclient",'apiclient.utils'],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
Expand Down