From 20aa0ab55b22950bee67cbf0ddb8b730674b34b8 Mon Sep 17 00:00:00 2001 From: Drew Gulino <1379399+dgulinobw@users.noreply.github.com> Date: Tue, 31 Jan 2023 18:32:08 -0500 Subject: [PATCH 1/5] provide a way to override the default request timeout --- apiclient/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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.""" From 64c6a3d3e607fec1075e52eee003567cee3169de Mon Sep 17 00:00:00 2001 From: Drew Gulino <1379399+dgulinobw@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:06:59 -0500 Subject: [PATCH 2/5] updating deps because security alerts --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c4d46e3..80d3018 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"] From bedde4137ea6c94158eab41888a7ce608a2c952a Mon Sep 17 00:00:00 2001 From: Drew Gulino <1379399+dgulinobw@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:15:13 -0500 Subject: [PATCH 3/5] updated setup.py to be compatible with python 3.10 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 80d3018..fc3a928 100644 --- a/setup.py +++ b/setup.py @@ -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", From 4711ff74f0581f179db4ccdcb12258c5b2f5cc1d Mon Sep 17 00:00:00 2001 From: Drew Gulino <1379399+dgulinobw@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:30:42 -0500 Subject: [PATCH 4/5] bumped version to 1.3.2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3a3cd8c..1892b92 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.1 +1.3.2 From ecc8d25a464c171bbd8be94c089111b97a030ff8 Mon Sep 17 00:00:00 2001 From: Drew Gulino <1379399+dgulinobw@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:33:02 -0500 Subject: [PATCH 5/5] improved packaging --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fc3a928..2097a7b 100644 --- a/setup.py +++ b/setup.py @@ -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,