Migrating httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient#1099
Merged
jamesbraza merged 8 commits intomainfrom Sep 24, 2025
Merged
Migrating httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient#1099jamesbraza merged 8 commits intomainfrom
httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient#1099jamesbraza merged 8 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the HTTP client from httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient throughout the codebase to align with OpenAI Python library requirements.
Key changes:
- Replace all instances of
httpx.AsyncClientwithhttpx_aiohttp.HttpxAiohttpClient - Add
httpx-aiohttpas a dependency in pyproject.toml - Update test fixtures and mocks to use the new client type
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Add httpx-aiohttp dependency |
| src/paperqa/clients/init.py | Replace httpx.AsyncClient with HttpxAiohttpClient in DocMetadataClient |
| src/paperqa/clients/crossref.py | Update retraction dataset download to use new client |
| src/paperqa/clients/journal_quality.py | Replace client in download function |
| src/paperqa/sources/clinical_trials.py | Update client initialization for clinical trials |
| src/paperqa/contrib/openreview_paper_helper.py | Replace client in PDF download method |
| tests/test_clients.py | Update all test cases to use new client type |
| tests/test_clinical_trials.py | Update mock fixture to use HttpxAiohttpClient spec |
| .pre-commit-config.yaml | Add uv.lock to exclude pattern |
Comments suppressed due to low confidence (1)
src/paperqa/clients/journal_quality.py:110
- The function parameter type annotation should be updated from
httpx.AsyncClientto match the new client type being used (httpx_aiohttp.HttpxAiohttpClient).
async def download(client_: httpx.AsyncClient) -> None:
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
whitead
approved these changes
Sep 23, 2025
Collaborator
whitead
left a comment
There was a problem hiding this comment.
LGTM, pending vcr fixes
httpx.AsyncClient to httpx_aiohttp. HttpxAiohttpClienthttpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient
d0664bd to
481446b
Compare
…re for large files
481446b to
5c6069e
Compare
Collaborator
Author
They are done now 👌 merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligning with openai/openai-python#1596 (comment)