From 7a5c1bb13841132eb467bcbf7e89033e8cdd6203 Mon Sep 17 00:00:00 2001 From: "gocardless-ci-robot[bot]" <123969075+gocardless-ci-robot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 10:53:27 +0000 Subject: [PATCH] Changes generated by 2c9c63561144da3c5fb3782bfa64c12fdc5e0c24 This commit was automatically created from gocardless/client-library-templates@2c9c63561144da3c5fb3782bfa64c12fdc5e0c24 by the `push-files` action. Workflow run: https://github.com/gocardless/client-library-templates/actions/runs/40310541205 --- CHANGELOG.md | 16 ++++++++++++++++ gocardless_pro/__init__.py | 2 +- gocardless_pro/api_client.py | 4 ++-- setup.py | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5678f7..e9e2792a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ # Changelog +## 3.22.0 (2026-10-26) + +### Features + +#### Add a `timeout` client option, with a 60 second default + +`Client` now accepts a `timeout` argument that is passed to `requests` on every call, so a request that gets no response in time raises `requests.Timeout`. It takes seconds, or a `(connect, read)` tuple to set the two limits separately, or `None` to wait indefinitely. + +```python +client = gocardless_pro.Client(access_token=token, environment='live', timeout=10) +``` + +Previously requests had no timeout, so a stalled connection could hang forever. Requests now time out after 60 seconds by default. If you rely on requests taking longer than that, pass a larger `timeout` or `None`. + +Requests that time out are retried by the library's existing automatic retry logic before the error is raised. + ## 3.21.0 (2026-10-12) ### Features diff --git a/gocardless_pro/__init__.py b/gocardless_pro/__init__.py index f712263f..9fbd0853 100644 --- a/gocardless_pro/__init__.py +++ b/gocardless_pro/__init__.py @@ -2,5 +2,5 @@ from .client import Client -__version__ = '3.21.0' +__version__ = '3.22.0' diff --git a/gocardless_pro/api_client.py b/gocardless_pro/api_client.py index 5ea3bc10..4858ed69 100644 --- a/gocardless_pro/api_client.py +++ b/gocardless_pro/api_client.py @@ -201,7 +201,7 @@ def _default_headers(self): 'Authorization': 'Bearer {0}'.format(self.access_token), 'Content-Type': 'application/json', 'GoCardless-Client-Library': 'gocardless-pro-python', - 'GoCardless-Client-Version': '3.21.0', + 'GoCardless-Client-Version': '3.22.0', 'User-Agent': self._user_agent(), 'GoCardless-Version': '2015-07-06', } @@ -210,7 +210,7 @@ def _user_agent(self): python_version = '.'.join(platform.python_version_tuple()[0:2]) vm_version = '{}.{}.{}-{}{}'.format(*sys.version_info) return ' '.join([ - 'gocardless-pro-python/3.21.0', + 'gocardless-pro-python/3.22.0', 'python/{0}'.format(python_version), '{0}/{1}'.format(platform.python_implementation(), vm_version), '{0}/{1}'.format(platform.system(), platform.release()), diff --git a/setup.py b/setup.py index c2c1a6c2..da063a65 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name = 'gocardless_pro', - version = '3.21.0', + version = '3.22.0', packages = find_packages(exclude=['tests']), install_requires = ['requests>=2.34.2'], python_requires = '>=3.6',