Regenerate the synchronous client with the modern Python generator#2631
Regenerate the synchronous client with the modern Python generator#2631tamird wants to merge 7 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 |
| @@ -1 +1 @@ | |||
| 6.6.0 No newline at end of file | |||
| 7.24.0-SNAPSHOT | |||
There was a problem hiding this comment.
it's not released, IMHO released version should be used instead
There was a problem hiding this comment.
Yes, that's why this is a draft. It requires some changed that are not yet released.
There was a problem hiding this comment.
Agreed. The three prerequisite generator fixes have merged, but they are not released yet. I updated the draft description to make that boundary explicit: this stays inspection-only until client-gen can pin the first released version containing them and regenerate canonically.
Regenerate the synchronous client from kubernetes-client/gen 0c53b5c7299 and OpenAPI Generator 53d8dc8e687, which contains the merged legacy-runtime and API-key-prefix compatibility fixes. This removes the temporary patch provenance from the downstream prototype and keeps the draft aligned with the generator branch it references.
The legacy-compatible modern generator preserves raw responses through the ordinary method's _preload_content=False option instead of emitting *_without_preload_content siblings. Route WebSocket requests through that generated path so request serialization remains generated while the stream adapter supplies the response wrapper expected by the legacy compatibility helper.
77e286b to
6bc343e
Compare
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:information;
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 checked-in output uses kubernetes-client/gen commit 0c53b5c7 and
OpenAPI Generator source commit 53d8dc8e. The required generator fixes
have merged upstream as OpenAPITools/openapi-generator#24290,
OpenAPITools/openapi-generator#24300, and
OpenAPITools/openapi-generator#24307, but are not released yet. Before
marking this ready, client-gen will pin the first released OpenAPI
Generator version containing those fixes and regenerate this branch
again.
The source-pin render was produced by the normal
scripts/update-client.shDocker path inhttps://github.com/tamird/kubernetes-python/actions/runs/29457631858.
The current head passes the fork's Python 3.10-3.14 lint and test matrix:
https://github.com/tamird/kubernetes-python/actions/runs/29458541599.
Does this PR introduce a user-facing change?
Additional documentation: