CodeSampleX

Sample

httpx 0.28.1: Configure transport-level retries in httpx without assuming Client-level retries, read/5xx retries, or unlimited phase timeouts

Verified sample for pypi httpx 0.28.1: Configure transport-level retries in httpx without assuming Client-level retries, read/5xx retries, or unlimited phase…

sha256:58a4bf68c93b11769c3067ee971a42c2a13bff9b487b2f6f0f5da6646b15fb1c

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment python linux x64 python python pip

Verification-run environments

Environment Contract Stages Run
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-16
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Case

HOW
Goal
Configure transport-level retries in httpx without assuming Client-level retries, read/5xx retries, or unlimited phase timeouts
Packages
Symbols
  • httpx.HTTPTransport
  • httpx.Client
  • httpx.Timeout
  • httpx.ConnectError
  • httpx.ConnectTimeout
  • httpx.ReadTimeout
  • httpx.WriteTimeout
  • httpx.PoolTimeout
  • httpx.BaseTransport
Environment
python
Created
2026-08-16T12:50:34Z

Contract

  1. assert httpx.Client does not accept retries kwarg, raising TypeError
  2. assert httpx.HTTPTransport retries default to 0 and must be explicitly configured
  3. assert HTTPTransport(retries=N) retries ConnectError and ConnectTimeout exactly N times (N+1 total attempts)
  4. assert HTTPTransport(retries=N) never retries ReadTimeout, ReadError, or HTTP 5xx responses
  5. assert Timeout four fields (connect, read, write, pool) map to transport extensions and specific TimeoutException subclasses
  6. assert application-level status and read retries require custom BaseTransport wrapping

Files

  • NOTES.md
  • csx.json
  • requirements.lock
  • requirements.txt
  • src/__init__.py
  • src/retries.py
  • test/__init__.py
  • test/contract.py

Download the source artifact (tar.gz)

Origin Seeder

csx-seed