| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
Split the commit to exclude the changes to pdm.lock file as that was causing merge conflicts and rebased the changes over the current state of main. Let me know if you need anything else! |
Sorry, something went wrong.
|
@s-sajid-ali Per discussion here Would you be willing to modify this PR to target only httpx2? We can skip the complexities of trying to support both given the way the community is moving. |
Sorry, something went wrong.
|
Sure, it should be much easier to move everything over to httpx2 and not support both. I'll get the change in place by the middle of the upcoming week. |
Sorry, something went wrong.
new file: .changeset/default_to_httpx2.md modified: end_to_end_tests/functional_tests/generated_code_execution/test_path_parameters.py modified: end_to_end_tests/golden-records/docstrings-on-attributes-golden-record/README.md modified: end_to_end_tests/golden-records/docstrings-on-attributes-golden-record/my_test_api_client/client.py modified: end_to_end_tests/golden-records/docstrings-on-attributes-golden-record/my_test_api_client/types.py modified: end_to_end_tests/golden-records/docstrings-on-attributes-golden-record/pyproject.toml modified: end_to_end_tests/golden-records/escapes-client/README.md modified: end_to_end_tests/golden-records/escapes-client/escapes_client/api/default/get_weird_responses.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/api/default/misc_metadata_escapes.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/api/default/non_string_example.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/api/default/property_escapes.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/api/printtag_escape/with_braces_path.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/client.py modified: end_to_end_tests/golden-records/escapes-client/escapes_client/types.py modified: end_to_end_tests/golden-records/escapes-client/pyproject.toml modified: end_to_end_tests/golden-records/my-enum-api-client/README.md modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/api/enums/bool_enum_tests_bool_enum_post.py modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/api/enums/int_enum_tests_int_enum_post.py modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/api/tests/get_user_list.py modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/api/tests/post_user_list.py modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/client.py modified: end_to_end_tests/golden-records/my-enum-api-client/my_enum_api_client/types.py modified: end_to_end_tests/golden-records/my-enum-api-client/pyproject.toml modified: end_to_end_tests/golden-records/my-test-api-client/README.md modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/bodies/json_like.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/bodies/optional_body.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/bodies/post_bodies_multiple.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/bodies/refs.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/config/content_type_override.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/get_common_parameters.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/get_models_allof.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/get_models_oneof_with_required_const.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/post_common_parameters.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/post_types_unions_duplicate_types.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/default/reserved_parameters.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/defaults/defaults_tests_defaults_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/enums/bool_enum_tests_bool_enum_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/enums/int_enum_tests_int_enum_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/location/get_location_header_types.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/location/get_location_query_optionality.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/naming/hyphen_in_path.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/naming/mixed_case.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/naming/post_naming_property_conflict_with_import.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/parameters/multiple_path_parameters.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/default_status_code.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/post_responses_unions_simple_before_complex.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/reference_response.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/status_code_patterns.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/status_code_precedence.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/responses/text_response.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tag1/get_tag_with_number.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tag2/get_tag_with_number.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/callback_test.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/description_with_backslash.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/get_basic_list_of_booleans.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/get_basic_list_of_floats.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/get_basic_list_of_integers.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/get_basic_list_of_strings.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/get_user_list.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/json_body_tests_json_body_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/no_response_tests_no_response_get.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/octet_stream_tests_octet_stream_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/post_form_data.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/post_form_data_inline.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/post_tests_json_body_string.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/test_inline_objects.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/token_with_cookie_auth_token_with_cookie_get.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/unsupported_content_tests_unsupported_content_get.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/tests/upload_file_tests_upload_post.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/api/true_/false_.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/client.py modified: end_to_end_tests/golden-records/my-test-api-client/my_test_api_client/types.py modified: end_to_end_tests/golden-records/my-test-api-client/pyproject.toml modified: end_to_end_tests/golden-records/test-3-1-features-client/README.md modified: end_to_end_tests/golden-records/test-3-1-features-client/pyproject.toml modified: end_to_end_tests/golden-records/test-3-1-features-client/test_3_1_features_client/api/const/post_const_path.py modified: end_to_end_tests/golden-records/test-3-1-features-client/test_3_1_features_client/api/prefix_items/post_prefix_items.py modified: end_to_end_tests/golden-records/test-3-1-features-client/test_3_1_features_client/client.py modified: end_to_end_tests/golden-records/test-3-1-features-client/test_3_1_features_client/types.py modified: end_to_end_tests/metadata_snapshots/pdm.pyproject.toml modified: end_to_end_tests/metadata_snapshots/poetry.pyproject.toml modified: end_to_end_tests/metadata_snapshots/setup.py modified: end_to_end_tests/metadata_snapshots/uv.pyproject.toml modified: integration-tests/README.md modified: integration-tests/integration_tests/api/body/post_body_multipart.py modified: integration-tests/integration_tests/api/parameters/post_parameters_header.py modified: integration-tests/integration_tests/client.py modified: integration-tests/integration_tests/types.py modified: integration-tests/pyproject.toml modified: integration-tests/tests/test_api/test_body/test_post_body_multipart.py modified: openapi_python_client/__init__.py modified: openapi_python_client/parser/responses.py modified: openapi_python_client/templates/README.md.jinja modified: openapi_python_client/templates/client.py.jinja modified: openapi_python_client/templates/endpoint_macros.py.jinja modified: openapi_python_client/templates/endpoint_module.py.jinja modified: openapi_python_client/templates/pyproject_pdm.toml.jinja modified: openapi_python_client/templates/pyproject_poetry.toml.jinja modified: openapi_python_client/templates/pyproject_uv.toml.jinja modified: openapi_python_client/templates/setup.py.jinja modified: openapi_python_client/templates/types.py.jinja modified: pyproject.toml
modified: integration-tests/pdm.lock modified: integration-tests/pdm.minimal.lock modified: pdm.lock modified: pdm.minimal.lock
…0, h/t to codex for finding this issue
|
Updated to only use httpx2 and ready for another review. This now includes breaking API changes as noted in the changeset:
Since this is a major version change that breaks with httpx, I'm assuming that this API change is acceptable. If not, these APIs can be kept as is. |
Sorry, something went wrong.
|
I think migrating to *_httpx2_client function names makes sense. It's probably safer to be explicit about this and it's nicer longer term. This change can be easily detected by type checkers and IDEs, so hopefully that makes the migration straight forward. |
Sorry, something went wrong.
There was a problem hiding this comment.
CI failures need fixed.
Sorry, something went wrong.
|
CI needs permission to re-run but format checks are now clean: ~/D/p/openapi-python-client (httpx-switch-default-to-2)> git log -n 1
commit cd3b41cb0aeec512779f34c6763f79ee1254d3d4 (HEAD -> httpx-switch-default-to-2, origin/httpx-switch-default-to-2)
Author: Sajid Ali <sajidsyed2021@u.northwestern.edu>
Date: Tue Sep 22 19:43:01 2026 -0400
ruff format in integration-tests/ to fix formatting error from CI
~/D/p/openapi-python-client (httpx-switch-default-to-2)> pdm run ruff format . --check
130 files already formatted
|
Sorry, something went wrong.
|
Since this isn't merged yet, perhaps we bump the minimum version to 2.13.1 that was just released |
Sorry, something went wrong.
|
Updated to 2.13.1 as requested and I see that the CI failures from the last run are unrelated to this branch, with the following being a representative failure: PLR0917 Too many positional arguments (8 > 5) --> tests/test_parser/test_properties/test_union.py:34:5 | 34 | def test_union_oneOf_descriptive_type_name( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 35 | union_property_factory, 36 | date_time_property_factory, | This would be best addressed in a separate PR with two commits capturing the changes from: pdm ruff check --fix . and pdm ruff check --fix --unsafe-fixes . with a review focused on the changes introduced by the second commit. |
Sorry, something went wrong.
I think I'd rather keep the old method names to make it easier for folks to upgrade. It does run the risk of someone not reading the changelog and not using a type checker but... I think the greater risk is folks not upgrading at all.
It looks like this branch updated dependencies unrelated to httpx2 (specifically Ruff) which are what caused the failure. We should upgrade Ruff separately and address the issues, but this doesn't need to be blocked by that Thanks to you both for working on this! |
Sorry, something went wrong.
|
Unless another PR is wanted to either make the following quick change (no code changes) or actually address the lints, the following quick fix will silence the failures. Both are stylistic rather than functional lints. diff --git a/pyproject.toml b/pyproject.toml
index 1157377..6a72fc1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -69,7 +69,7 @@ exclude = [
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "PL", "RUF"]
-ignore = ["E501", "PLR0913", "PLR2004"]
+ignore = ["E501", "PLR0913", "PLR0917", "PLR2004", "RUF036"]
[tool.ruff.lint.per-file-ignores]
"openapi_python_client/cli.py" = ["B008"]PLR0917: https://docs.astral.sh/ruff/rules/too-many-positional-arguments The latter ruff reports as unsafe, but the rule documentation seems to dismiss that. |
Sorry, something went wrong.
|
I made a branch that does this before I realized this one exists. In case it is helpful, my branch has resolved the lockfile issues and changes in newer ruff versions by minimizing the lockfile updates: #1505 |
Sorry, something went wrong.
|
Apologies for the delayed update, the last commit should fix the issues with CI now as ruff is back to the pinned 0.15.18 in pdm.lock. |
Sorry, something went wrong.
|
@dbanty This is ready for your review. |
Sorry, something went wrong.
…and reduce breakage)
There was a problem hiding this comment.
Thanks y'all! I did swap httpx2_args back to httpx_args to match set_httpx_client and get_httpx_client. Hopefully that means the most downstream consumers will have to do is swap their imports
Sorry, something went wrong.
> [!IMPORTANT] > Merging this pull request will create this release ## ❗️Breaking ❗ ### Switch from `httpx` to `httpx2` in generated clients [`httpx2`](https://pydantic.dev/docs/httpx2/get-started/) is largely compatible with `httpx` and should only be a breaking change for users who customize the internal `Client`. Thanks to @s-sajid-ali and @johnthagen for making this one happen in PR openapi-generators#1461 and discussion openapi-generators#1455! ## 🚀 Features - Update `uv_build` to 0.13 when using `--meta=uv` (openapi-generators#1507) ## 🐛 Fixes - Let httpx2 choose the multipart/form-data boundary (openapi-generators#1511) ### Let httpx2 choose the boundary for `multipart/form-data` requests Since 0.29.0, generated endpoints sent every `multipart/form-data` body with the fixed boundary `+++`, so an uploaded file containing `\r\n--+++` was cut short at that point (openapi-generators#1509). These bodies no longer set `Content-Type`, so httpx2 sets it with a random boundary for each request, as single-body endpoints did before 0.29.0. Endpoints with several body types still get a boundary (openapi-generators#947). Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
|
Thanks for catching that and for helping throughout the process! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR assumes that the deprecation of generating clients with httpx is imminent and updates all golden records to use httpx2 instead. This leaves the client generation process with legacy httpx untested. This will cause issues when httpx2 introduces breaking changes and it is assumed that the option to use httpx will be removed by that time.
Additionally, this leaves the generated methodget_httpx_client as is, preferring to update it to get_httpx2_client when support for httpx is removed.