Skip to content

Conversation

@wuqunfei
Copy link

This change replaces httpx with the requestx library (v1.0.3) as the HTTP client for the OpenAI Python SDK. Key changes include:

  • Updated pyproject.toml to use requestx from GitHub (requires Python 3.12+)
  • Updated all source files to import and use requestx instead of httpx
  • Created wrapper classes for requestx.Client and requestx.AsyncClient since they cannot be subclassed (Rust extension types)
  • Added URL class implementation in _types.py for compatibility
  • Updated all test files to use requestx
  • Added compatibility handling for missing attributes (is_closed, timeout, is_stream_consumed) that requestx doesn't provide
  • Removed respx (httpx mock library) since it's incompatible with requestx

Note: Some tests that relied on respx mocking will need to be updated with an alternative mocking approach.

https://claude.ai/code/session_01LjnafWCSDa7FxCDB5E54DP

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Additional context & links

This change replaces httpx with the requestx library (v1.0.3) as the HTTP
client for the OpenAI Python SDK. Key changes include:

- Updated pyproject.toml to use requestx from GitHub (requires Python 3.12+)
- Updated all source files to import and use requestx instead of httpx
- Created wrapper classes for requestx.Client and requestx.AsyncClient since
  they cannot be subclassed (Rust extension types)
- Added URL class implementation in _types.py for compatibility
- Updated all test files to use requestx
- Added compatibility handling for missing attributes (is_closed, timeout,
  is_stream_consumed) that requestx doesn't provide
- Removed respx (httpx mock library) since it's incompatible with requestx

Note: Some tests that relied on respx mocking will need to be updated with
an alternative mocking approach.

https://claude.ai/code/session_01LjnafWCSDa7FxCDB5E54DP
wuqunfei pushed a commit to neuesql/requestx that referenced this pull request Jan 27, 2026
- Make Client and AsyncClient subclassable via PyO3 subclass attribute
- Add timeout getter to Client and AsyncClient to expose configured timeout
- Change URL.raw_path to return bytes instead of str (HTTPX compatible)
- Add BaseTransport and AsyncBaseTransport Protocol stubs for type checking
- Bump version to 1.0.5

These changes address the compatibility issues identified in:
neuesql/openai-python#1

https://claude.ai/code/session_012d1P2tyccgiracqGeVsC2V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants