Regenerate the synchronous client with the modern Python generator#2631
Regenerate the synchronous client with the modern Python generator#2631tamird wants to merge 5 commits into
Conversation
OpenAPI Generator v7 removed python-legacy. Regenerate with the modern python generator from client-gen commit 7529a2f1 plus the temporary compatibility patch for OpenAPITools/openapi-generator#24290. This commit intentionally contains only generated output and the preprocessed Swagger spec. Handwritten adapters follow separately.
The modern Python generator imports Pydantic and typing-extensions, and its requirements template now requires python-dateutil 2.8.2 and urllib3 2.6.3 through 2.x. Package the generated py.typed marker with both normal and release builds.
The modern Python generator replaces request() with param_serialize()/call_api(), exposes raw responses through *_without_preload_content siblings, annotates return types, and changes deserialize(). Update the dynamic client, OIDC refresh, stream, watch, YAML helper, and examples to use those contracts. DynamicClient keeps accepting async_req because the old implementation immediately resolved its future with .get(). The synchronous YAML helper rejects async_req=True instead of passing an unsupported argument into generated methods. Add focused HTTP and stream regressions for these compatibility paths.
The modern generation path owns the behaviors that release.sh previously reconstructed by cherry-picking old commits and applying transport patches. Remove that second mutation phase and its patch scripts so update-client.sh leaves the canonical generated tree intact. Ignore new generator support files that this package does not ship, and remove the obsolete hot-issues release instructions.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tamird The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
technically ton of (urllib compatibility, typing, several broken places with |
| @@ -1,10 +1,12 @@ | |||
| certifi>=14.05.14 # MPL | |||
| six>=1.9.0 # MIT | |||
There was a problem hiding this comment.
six is needed only for async after merge. Regenerate too as next PR?
There was a problem hiding this comment.
Yes. This draft intentionally migrates only synchronous generation; async should be regenerated separately. setup.py reads requirements.txt, while the release package adds requirements-asyncio.txt, so I removed six from the synchronous requirements and left its async declaration in place.
|
Right; this is not tied to one tracked issue. I updated that section to name the urllib compatibility, typing, and bytes-handling gaps instead of saying |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The synchronous client is still generated with OpenAPI Generator 6.6's
python-legacybackend. OpenAPI Generator removed that backend in v7,so the current generation path cannot move to a supported generator or
inherit the modern Python generator's native type information.
This draft shows the complete downstream result of moving the
synchronous client to the modern
pythonbackend:methods;
py.typed;modern generated API; and
obsolete.
Which issue(s) this PR fixes:
No single tracked issue. The regeneration fixes existing urllib
compatibility, typing, and bytes-handling gaps in the synchronous
client.
Special notes for your reviewer:
This is an inspection draft, not a merge-ready change. It covers only
the synchronous generator. The async client remains on its existing
generator path and should be regenerated separately; until then,
sixremains an async requirement.The generated output uses kubernetes-client/gen commit b904a3c7, pinned
to OpenAPI Generator commit c797da89 plus the temporary
python-legacy-compat.patch. That patch carriesOpenAPITools/openapi-generator#24290's
compatibleWithPythonLegacyoption so the modern generator preservesthe synchronous client's existing public model and configuration
behavior.
Before marking this ready, client-gen should pin an upstream generator
source containing OpenAPITools/openapi-generator#24290,
OpenAPITools/openapi-generator#24300, and
OpenAPITools/openapi-generator#24307, delete the temporary patch
plumbing, and regenerate this branch canonically.
Focused config, dynamic, stream, watch, generated-API, and proxy
coverage passes 143 tests plus 9 subtests. The cumulative diff also
passes
git diff --check.Does this PR introduce a user-facing change?
Additional documentation: