Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Feature Request: Add Configurable Network Timeouts to HTTP Clients

オープン
#18 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.0 to Client and AsyncClient.
  • Add timeout: float = 30.0 to OauthClient and AsyncOauthClient.
  • Pass this parameter into the underlying httpx client natively.
  • Ensure full backward compatibility—if a user manually passes a custom httpx client, their settings are preserved and not overridden.
  • Update README.md and 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 httpx library.
主要言語
Python
スター
18
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openapi/openapi-python-sdk のほかの issue

openapi/openapi-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。