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

Sync mode support for the httpx family

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
32/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

Read caldav/davclient.py alongside caldav/async_davclient.py to understand the sync client’s requests/niquests assumptions and the async client’s _USE_HTTPX handling. Check caldav/response.py for existing response compatibility; the issue leaves open whether to add a sync switch or design a shared transport layer. Done means the sync client can use the httpx family without requiring requests or niquests.

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

説明

enhancement

We should support using httpx2 for sync-requests, it seems preferable to the old requests module. The text below is AI-generated.


Today the two clients accept different HTTP libraries:

  • async (caldav/async_davclient.py): niquests, then httpx2, then httpxyz,
    then httpx - whichever imports first.
  • sync (caldav/davclient.py): niquests, then requests. The httpx family is
    not an option at all.

So a project that already depends on httpx, and uses caldav synchronously, has to
pull in requests or niquests purely for this library. That is the same argument
as https://github.com/python-caldav/caldav/issues/690 - a library should prefer
the HTTP stack its consumer already has, rather than adding one - and it was
raised in https://github.com/python-caldav/caldav/issues/611#issuecomment-5335287677:

Considering that, we should consider supporting httpx/httpx2 also for sync
operations. However, this will have to wait for 3.4 - at least.

Filing it so it does not get lost.

What is involved

The sync client is written against the requests API and niquests is a drop-in for
it, which is why that fallback was nearly free. httpx is not a drop-in:

  • requests.Session / niquests.Session vs httpx.Client
  • requests.auth.AuthBase vs httpx.Auth - different contract, and
    _HttpxBearerAuth already exists in the async client for exactly this
  • response.reason vs response.reason_phrase - caldav/response.py already
    handles both
  • different exception hierarchies, which matters wherever the client catches
    connection or timeout errors
  • close() vs close() is fine, but the context-manager semantics differ

The async client already carries most of these distinctions behind _USE_HTTPX;
the interesting question is whether the sync client should grow the same switch or
whether the two should share one thin transport layer. The latter is more work
and much better, and is probably a 4.0 conversation rather than a 3.4 one.

Not urgent

Nothing is broken; this is about not forcing a dependency on consumers who
already have one that would do.

主要言語
Python
スター
412
フォーク
113
平均マージ
1日 2時間
マージ済み PR(30日)
41

環境構築

はじめの一歩

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

python-caldav/caldav のほかの issue

python-caldav/caldav の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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