Feature Request: Add Configurable Network Timeouts to HTTP Clients
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 56/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- python
- Domínio
- backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 18
- Forks
- 4
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de openapi/openapi-python-sdk
-
Rename package to openapi-sdk (PyPI approval in progress)Talvez já em andamento @francescobianco assumiu há 107 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 15/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
openapi/openapi-python-sdk#20 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
-
good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 55/100
openapi/openapi-python-sdk#9 · 7 comentários ·
Todas as issues de openapi/openapi-python-sdk
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Deltares/imod-python#1940 ·
Mantenedores costumam responder em até 1 dia
-
effort: low prio: low ready
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
digitalfabrik/integreat-cms#4621 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
ioos/compliance-checker#1375 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia