Feature Request: Add Configurable Network Timeouts to HTTP Clients
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 56/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Calme
- Stack technique
- python
- Domaine
- backend-api-design
Piste de recherche
Start by locating the initialization methods for Client, AsyncClient, OauthClient, and AsyncOauthClient, then check how they construct or accept httpx clients. Trace the existing README.md examples and project tests for custom client behavior. Done means all four clients support the documented timeout setting, custom httpx client settings remain intact, and the updated examples are included.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
The Problem
By default, the underlying httpx HTTP library used by this SDK applies a strict 5-second timeout to all network requests.
If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a TimeoutException.
Currently, the only way for developers to fix this is to understand how httpx works underneath, build a custom httpx.Client() object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.
Proposed Solution
We should add a built-in timeout parameter directly into the initialization methods of all our clients (Client, AsyncClient, OauthClient, and AsyncOauthClient), giving it a safer default limit of 30.0 seconds.
Expected behavior:
# Before: Developers had to do all this
import httpx
custom_client = httpx.Client(timeout=60.0)
client = Client(token="abc", client=custom_client)
# After: Simple, clean SDK syntax
client = Client(token="abc", timeout=60.0)
Acceptance Criteria
- Add
timeout: float = 30.0toClientandAsyncClient. - Add
timeout: float = 30.0toOauthClientandAsyncOauthClient. - Pass this parameter into the underlying
httpxclient natively. - Ensure full backward compatibility—if a user manually passes a custom
httpxclient, their settings are preserved and not overridden. - Update
README.mdand PyPI docs with code examples showing how to configure the timeout. - Verify all existing unit tests pass cleanly.
Why this matters / Benefits
- Smarter Defaults: Bumping the default timeout from 5 to 30 seconds prevents the SDK from crashing during heavier, perfectly valid API workloads.
- Better Developer Experience (DX): Allows users to configure timeouts cleanly in one line of code without needing to learn the intricacies of the underlying
httpxlibrary.
- Langage dominant
- Python
- Étoiles
- 18
- Forks
- 4
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de openapi/openapi-python-sdk
-
Rename package to openapi-sdk (PyPI approval in progress)Peut-être pris @francescobianco l’a pris il y a 108 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 15/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
openapi/openapi-python-sdk#20 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
-
good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 55/100
openapi/openapi-python-sdk#9 · 7 commentaires ·
Toutes les issues de openapi/openapi-python-sdk
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
jbacalso24/mimry#291 ·
Les mainteneurs répondent en général sous 1 jour
-
good first issue
Difficulté 2/5 Moins d'une heure Accessibilité débutants 82/100
eli-alvarado/us-watchlist-alerts#14 ·
Les mainteneurs répondent en général sous 1 jour
-
from-review-extraction python severity:nit
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
LearningCircuit/local-deep-research#7462 ·
Les mainteneurs répondent en général sous 2 jours
-
mermaid_extract.py silently discards single-line state-diagram notes; sequence notes are keptOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
cathrynlavery/diagram-design#441 ·
Les mainteneurs répondent en général sous 2 jours
-
[Cleanup] Include the public header in work_split.cppPeut-être pris @blozano-tt l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
tenstorrent/tt-metal#60850 ·
Les mainteneurs répondent en général sous 1 jour