Skip to content

fix!: migrate from httpx to httpx2#48

Merged
aldbr merged 2 commits into
DIRACGrid:masterfrom
kjvbrt:feat/httpx2
Jul 17, 2026
Merged

fix!: migrate from httpx to httpx2#48
aldbr merged 2 commits into
DIRACGrid:masterfrom
kjvbrt:feat/httpx2

Conversation

@kjvbrt

@kjvbrt kjvbrt commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • httpx is dormant; pydantic has taken over maintenance under the httpx2 name (https://github.com/pydantic/httpx2)
  • Swap the httpx dependency for httpx2 and update all imports/usages (httpx.Client, httpx.AsyncClient, httpx.Response, httpx.HTTPError, etc.) across src/, tests/, and benchmark_tests/

Breaking change

  • Renamed the Client/AsyncClient constructor kwarg httpx_max_connections to max_connections.

Closes #46

httpx is dormant; pydantic has taken over maintenance under the
httpx2 name. Swap the dependency and all imports/usages accordingly,
following the same approach DIRACGrid/diracx used in #948.

Closes DIRACGrid#46
@aldbr
aldbr requested a review from chrisburr July 16, 2026 08:09
@chrisburr

Copy link
Copy Markdown
Member

I would go with max_connections.

@kjvbrt

kjvbrt commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Should max_connections be used also in the DiracX proper?

BREAKING CHANGE: Client and AsyncClient now accept max_connections
instead of httpx_max_connections. The httpx_ prefix leaked an
implementation detail that isn't meaningful to callers.
@github-actions

Copy link
Copy Markdown
Test 3.11 3.12 3.13 3.14
copy_object_aio 1.044 1.049 1.697 1.116
copy_object_sync 1.297 1.367 1.396 1.391
create_bucket_aio 0.987 0.990 0.986 1.058
create_bucket_aio_cm 0.995 1.000 0.989 1.048
create_bucket_sync 1.154 1.166 1.167 1.121
create_bucket_sync_cm 1.148 1.166 1.150 1.110
delete_objects_aio 0.977 0.970 1.005 0.775
delete_objects_aio_cm 0.991 1.003 0.992 1.026
delete_objects_sync 1.008 1.025 1.005 0.897
delete_objects_sync_cm 1.018 1.015 1.010 1.048
generate_presigned_post_aio 9.196 8.869 8.950 8.963
generate_presigned_post_aio_cm 9.337 9.024 8.945 9.170
generate_presigned_post_sync 7.291 6.969 7.124 7.226
generate_presigned_post_sync_cm 7.390 6.902 7.055 6.907
generate_presigned_url_aio 15.765 15.270 15.675 18.379
generate_presigned_url_aio_cm 15.958 15.525 15.389 17.447
generate_presigned_url_sync 15.645 14.374 15.155 16.659
generate_presigned_url_sync_cm 15.987 14.809 14.214 17.415
head_bucket_aio 0.991 1.003 0.995 1.032
head_bucket_aio_cm 1.012 0.986 1.003 1.007
head_bucket_sync 1.462 1.565 1.562 1.645
head_bucket_sync_cm 1.469 1.580 1.557 1.561
head_object_aio 0.917 0.948 0.933 0.946
head_object_aio_cm 0.920 0.944 0.908 0.945
head_object_sync 1.522 1.578 1.580 1.526
head_object_sync_cm 1.538 1.604 1.561 1.544
list_objects_aio 1.122 1.142 1.141 1.137
list_objects_sync 1.316 1.346 1.296 1.409
put_object_aio 1.186 1.170 1.129 1.140
put_object_sync 0.923 1.653 1.594 1.673
upload_file_aio 1.106 1.086 1.064 1.124
upload_file_sync 2.088 2.147 2.103 2.259

@aldbr

aldbr commented Jul 16, 2026

Copy link
Copy Markdown

Should max_connections be used also in the DiracX proper?

What's going to happen is that once this PR is merged, renovate will try to update the diracx lock file in DIRACGrid/diracx#898.

At this point, we will need to make the same adjustment in diracx as part of the renovate PR I would say

@aldbr

aldbr commented Jul 16, 2026

Copy link
Copy Markdown

To inform consumers we are introducing a breaking change, we should use the ! in the PR title. See: https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with--to-draw-attention-to-breaking-change

@chrisburr chrisburr changed the title fix: migrate from httpx to httpx2 fix!: migrate from httpx to httpx2 Jul 16, 2026
@aldbr
aldbr merged commit 3d4050e into DIRACGrid:master Jul 17, 2026
10 checks passed
@aldbr

aldbr commented Jul 17, 2026

Copy link
Copy Markdown

Note: while reviewing the PR, I noticed a few possible changes that could be made but they are outside of the scope of the issue. So I created #49 and #50

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.

Move to httpx2

3 participants