Skip to content

Commit 811b17a

Browse files
chore: sync repo
1 parent 5317550 commit 811b17a

File tree

5 files changed

+8
-64
lines changed

5 files changed

+8
-64
lines changed

.github/workflows/create-releases.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/publish-pypi.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# workflow for re-running publishing to PyPI in case it fails for some reason
2-
# you can run this workflow by navigating to https://www.github.com/parallel-web/parallel-sdk-python/actions/workflows/publish-pypi.yml
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/parallel-web/parallel-sdk-python/actions/workflows/publish-pypi.yml
34
name: Publish PyPI
45
on:
56
workflow_dispatch:
67

8+
release:
9+
types: [published]
10+
711
jobs:
812
publish:
913
name: publish

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21-
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2221
PYPI_TOKEN: ${{ secrets.PARALLEL_PYPI_TOKEN || secrets.PYPI_TOKEN }}

bin/check-release-environment

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
errors=()
44

5-
if [ -z "${STAINLESS_API_KEY}" ]; then
6-
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7-
fi
8-
95
if [ -z "${PYPI_TOKEN}" ]; then
106
errors+=("The PARALLEL_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
117
fi

src/parallel/lib/_time.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,6 @@ def _raise_timeout(run_id: str, exc: Union[Exception, None]) -> NoReturn:
2828
raise TimeoutError(f"Fetching task run result for run id {run_id} timed out.") from exc
2929

3030

31-
def _is_retryable_error(status_code: int) -> bool:
32-
"""Determine if an error is retryable.
33-
34-
We retry the following HTTP status codes within the SDK:
35-
- 408 (Request Timeout): The server timed out waiting for the request
36-
- 503 (Service Unavailable): The server is temporarily unable to handle the request
37-
- 504 (Gateway Timeout): The gateway server timed out
38-
39-
These errors typically indicate temporary issues with the server or network
40-
that may resolve upon retry. We don't include 429 (Too Many Requests) as this
41-
indicates rate limiting, which requires backing off rather than immediate retries.
42-
43-
Note: This is a low-level retry mechanism within the SDK. Customers may want to
44-
implement their own retry logic at the application level for other error types.
45-
"""
46-
return status_code in (408, 503, 504)
47-
48-
4931
@contextlib.contextmanager
5032
def timeout_retry_context(run_id: str, deadline: float) -> Iterator[None]:
5133
"""Context manager for handling timeouts and retries when fetching task run results.
@@ -67,7 +49,8 @@ def timeout_retry_context(run_id: str, deadline: float) -> Iterator[None]:
6749
exc = e
6850
continue
6951
except APIStatusError as e:
70-
if _is_retryable_error(e.status_code):
52+
# retry on timeouts from the API
53+
if e.status_code == 408:
7154
exc = e
7255
continue
7356
raise

0 commit comments

Comments
 (0)