diff --git a/VERSION b/VERSION index 3a3cd8c..1892b92 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.1 +1.3.2 diff --git a/apiclient/client.py b/apiclient/client.py index 1313b20..ffa4985 100644 --- a/apiclient/client.py +++ b/apiclient/client.py @@ -11,9 +11,6 @@ LOG = logging.getLogger(__name__) -# Timeout in seconds (float) -DEFAULT_TIMEOUT = 10.0 - class APIClient: def __init__( @@ -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 @@ -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.""" diff --git a/setup.py b/setup.py index c4d46e3..2097a7b 100644 --- a/setup.py +++ b/setup.py @@ -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"] @@ -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, @@ -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",