Skip to content

Migrating httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient#1099

Merged
jamesbraza merged 8 commits intomainfrom
httpx-aiohttp
Sep 24, 2025
Merged

Migrating httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient#1099
jamesbraza merged 8 commits intomainfrom
httpx-aiohttp

Conversation

@jamesbraza
Copy link
Copy Markdown
Collaborator

@jamesbraza jamesbraza self-assigned this Sep 22, 2025
@jamesbraza jamesbraza added the enhancement New feature or request label Sep 22, 2025
Copilot AI review requested due to automatic review settings September 22, 2025 20:04
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 22, 2025
@dosubot
Copy link
Copy Markdown

dosubot bot commented Sep 22, 2025

Related Documentation

Checked 1 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.AsyncClient with httpx_aiohttp.HttpxAiohttpClient
  • Add httpx-aiohttp as 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.AsyncClient to 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.

Copy link
Copy Markdown
Collaborator

@whitead whitead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending vcr fixes

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 23, 2025
@jamesbraza jamesbraza changed the title Migrating httpx.AsyncClient to httpx_aiohttp. HttpxAiohttpClient Migrating httpx.AsyncClient to httpx_aiohttp.HttpxAiohttpClient Sep 23, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 23, 2025
@jamesbraza
Copy link
Copy Markdown
Collaborator Author

LGTM, pending vcr fixes

They are done now 👌 merging

@jamesbraza jamesbraza merged commit 3db7bf4 into main Sep 24, 2025
5 checks passed
@jamesbraza jamesbraza deleted the httpx-aiohttp branch September 24, 2025 01:54
@dosubot
Copy link
Copy Markdown

dosubot bot commented Sep 24, 2025

Documentation Updates

Checked 1 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants