diff --git a/thousandeyes-sdk-administrative/pyproject.toml b/thousandeyes-sdk-administrative/pyproject.toml index 5bbf4219..434a935a 100644 --- a/thousandeyes-sdk-administrative/pyproject.toml +++ b/thousandeyes-sdk-administrative/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Administrative API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-agents/pyproject.toml b/thousandeyes-sdk-agents/pyproject.toml index 74f2714d..b873f3fa 100644 --- a/thousandeyes-sdk-agents/pyproject.toml +++ b/thousandeyes-sdk-agents/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Agents API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-alerts/pyproject.toml b/thousandeyes-sdk-alerts/pyproject.toml index 4dec8053..339c1421 100644 --- a/thousandeyes-sdk-alerts/pyproject.toml +++ b/thousandeyes-sdk-alerts/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Alerts API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-bgp-monitors/pyproject.toml b/thousandeyes-sdk-bgp-monitors/pyproject.toml index 6b2e20f9..bce30389 100644 --- a/thousandeyes-sdk-bgp-monitors/pyproject.toml +++ b/thousandeyes-sdk-bgp-monitors/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK BGP Monitors API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-connectors/pyproject.toml b/thousandeyes-sdk-connectors/pyproject.toml index c06761cc..107f0ba7 100644 --- a/thousandeyes-sdk-connectors/pyproject.toml +++ b/thousandeyes-sdk-connectors/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Integrations API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-core/pyproject.toml b/thousandeyes-sdk-core/pyproject.toml index a40bd17c..fd54435e 100644 --- a/thousandeyes-sdk-core/pyproject.toml +++ b/thousandeyes-sdk-core/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Core" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-core/src/thousandeyes_sdk/core/thousandeyes_retry.py b/thousandeyes-sdk-core/src/thousandeyes_sdk/core/thousandeyes_retry.py index ecc8d90f..4427020f 100644 --- a/thousandeyes-sdk-core/src/thousandeyes_sdk/core/thousandeyes_retry.py +++ b/thousandeyes-sdk-core/src/thousandeyes_sdk/core/thousandeyes_retry.py @@ -48,11 +48,12 @@ class ThousandEyesRetry(Retry): history: Optional[tuple[RequestHistory, ...]] = None, respect_retry_after_header: bool = True, remove_headers_on_redirect: Collection[str] = Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT, - backoff_jitter: float = 0.0) -> None: + backoff_jitter: float = 0.0, + retry_after_max: int = Retry.DEFAULT_RETRY_AFTER_MAX) -> None: super().__init__(total, connect, read, redirect, status, other, allowed_methods, status_forcelist, backoff_factor, backoff_max, raise_on_redirect, raise_on_status, history, respect_retry_after_header, - remove_headers_on_redirect, backoff_jitter) + remove_headers_on_redirect, backoff_jitter, retry_after_max) def is_retry(self, method: str, status_code: int, has_retry_after: bool = False) -> bool: # Always retry on 429, regardless of method or status_forcelist diff --git a/thousandeyes-sdk-core/test/test_thousandeyes_retry.py b/thousandeyes-sdk-core/test/test_thousandeyes_retry.py index 944e5dd6..a3e460ff 100644 --- a/thousandeyes-sdk-core/test/test_thousandeyes_retry.py +++ b/thousandeyes-sdk-core/test/test_thousandeyes_retry.py @@ -41,3 +41,19 @@ def test_parse_reset_header_invalid(): retry = ThousandEyesRetry() assert retry._parse_reset_header("invalid") is None assert retry._parse_reset_header(None) is None + + +def test_retry_new_clones_with_retry_after_max(): + retry = ThousandEyesRetry(retry_after_max=3600) + cloned = retry.new() + assert isinstance(cloned, ThousandEyesRetry) + assert cloned.retry_after_max == 3600 + + +def test_retry_increment_on_429(): + response = Mock(spec=HTTPResponse) + response.status = 429 + response.headers = {"Retry-After": "0"} + retry = ThousandEyesRetry(total=1) + new_retry = retry.increment(method="GET", url="/test", response=response) + assert isinstance(new_retry, ThousandEyesRetry) diff --git a/thousandeyes-sdk-credentials/pyproject.toml b/thousandeyes-sdk-credentials/pyproject.toml index c71e1e9c..fa9816e7 100644 --- a/thousandeyes-sdk-credentials/pyproject.toml +++ b/thousandeyes-sdk-credentials/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Credentials API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-dashboards/pyproject.toml b/thousandeyes-sdk-dashboards/pyproject.toml index b6433f3f..c95fbaee 100644 --- a/thousandeyes-sdk-dashboards/pyproject.toml +++ b/thousandeyes-sdk-dashboards/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Dashboards API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-emulation/pyproject.toml b/thousandeyes-sdk-emulation/pyproject.toml index 82b9233a..73e420bd 100644 --- a/thousandeyes-sdk-emulation/pyproject.toml +++ b/thousandeyes-sdk-emulation/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Emulation API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-endpoint-agents/pyproject.toml b/thousandeyes-sdk-endpoint-agents/pyproject.toml index 1e72dee5..b9968a4f 100644 --- a/thousandeyes-sdk-endpoint-agents/pyproject.toml +++ b/thousandeyes-sdk-endpoint-agents/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Endpoint Agents API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml b/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml index 17cce6de..ba8fc57a 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml +++ b/thousandeyes-sdk-endpoint-instant-tests/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Endpoint Instant Scheduled Tests API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-endpoint-labels/pyproject.toml b/thousandeyes-sdk-endpoint-labels/pyproject.toml index 4ba71702..fbf91687 100644 --- a/thousandeyes-sdk-endpoint-labels/pyproject.toml +++ b/thousandeyes-sdk-endpoint-labels/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Endpoint Agent Labels API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-endpoint-test-results/pyproject.toml b/thousandeyes-sdk-endpoint-test-results/pyproject.toml index 88b8cf54..56d42c98 100644 --- a/thousandeyes-sdk-endpoint-test-results/pyproject.toml +++ b/thousandeyes-sdk-endpoint-test-results/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Endpoint Test Results API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-endpoint-tests/pyproject.toml b/thousandeyes-sdk-endpoint-tests/pyproject.toml index 47478ebf..dd0fd6d5 100644 --- a/thousandeyes-sdk-endpoint-tests/pyproject.toml +++ b/thousandeyes-sdk-endpoint-tests/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Endpoint Tests API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-event-detection/pyproject.toml b/thousandeyes-sdk-event-detection/pyproject.toml index 437c1490..4be216e4 100644 --- a/thousandeyes-sdk-event-detection/pyproject.toml +++ b/thousandeyes-sdk-event-detection/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Event Detection API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-instant-tests/pyproject.toml b/thousandeyes-sdk-instant-tests/pyproject.toml index f10d50ad..a0b3eeb7 100644 --- a/thousandeyes-sdk-instant-tests/pyproject.toml +++ b/thousandeyes-sdk-instant-tests/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Instant Tests API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-internet-insights/pyproject.toml b/thousandeyes-sdk-internet-insights/pyproject.toml index 12f3b7c8..7ccbcc6e 100644 --- a/thousandeyes-sdk-internet-insights/pyproject.toml +++ b/thousandeyes-sdk-internet-insights/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Internet Insights API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-snapshots/pyproject.toml b/thousandeyes-sdk-snapshots/pyproject.toml index 8f4e0a9c..97814c18 100644 --- a/thousandeyes-sdk-snapshots/pyproject.toml +++ b/thousandeyes-sdk-snapshots/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Test Snapshots API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-streaming/pyproject.toml b/thousandeyes-sdk-streaming/pyproject.toml index 3d9f3c18..959b0e84 100644 --- a/thousandeyes-sdk-streaming/pyproject.toml +++ b/thousandeyes-sdk-streaming/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK ThousandEyes for OpenTelemetry API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-tags/pyproject.toml b/thousandeyes-sdk-tags/pyproject.toml index 94402d71..0bea620a 100644 --- a/thousandeyes-sdk-tags/pyproject.toml +++ b/thousandeyes-sdk-tags/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Tags API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-test-results/pyproject.toml b/thousandeyes-sdk-test-results/pyproject.toml index c4489116..c17ca9a7 100644 --- a/thousandeyes-sdk-test-results/pyproject.toml +++ b/thousandeyes-sdk-test-results/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Test Results API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-tests/pyproject.toml b/thousandeyes-sdk-tests/pyproject.toml index 5310e17e..d21ad89d 100644 --- a/thousandeyes-sdk-tests/pyproject.toml +++ b/thousandeyes-sdk-tests/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Tests API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1", diff --git a/thousandeyes-sdk-usage/pyproject.toml b/thousandeyes-sdk-usage/pyproject.toml index e3fe5004..cbf058f8 100644 --- a/thousandeyes-sdk-usage/pyproject.toml +++ b/thousandeyes-sdk-usage/pyproject.toml @@ -9,7 +9,7 @@ description = "ThousandEyes SDK Usage API" license = { file = "LICENSE" } requires-python = ">= 3.8" dependencies = [ - "urllib3 >= 2.0.0", + "urllib3 >= 2.6.3", "python-dateutil >=2.8.2", "pydantic >=2.1.0", "typing-extensions >=4.7.1",