Regenerate the synchronous client with the modern Python generator#2631
Regenerate the synchronous client with the modern Python generator#2631tamird wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
Done. OpenAPI Generator v7.24.0 is released and contains the required compatibility fixes. I regenerated this branch from the release via kubernetes-client/gen#305; the checked-in VERSION is now 7.24.0 and the resolved generator commit is 203d4867. The canonical Docker render is https://github.com/tamird/kubernetes-python/actions/runs/29785873376.
77e286b to
6bc343e
Compare
|
/assign @yliaog |
6bc343e to
c248094
Compare
|
[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 |
2edde6c to
af93dd7
Compare
OpenAPI Generator v7 removed python-legacy, preventing the synchronous Kubernetes client from moving beyond v6.6.0 and inheriting the modern Python generator's native type information. Regenerate with the released v7.24.0 Python generator, declare its runtime requirements, package py.typed, and refresh the Sphinx API index. Adapt dynamic, stream, watch, OIDC, YAML, leader-election, and example callers to the modern transport and legacy-compatible response behavior. Remove obsolete post-generation hotfixes while retaining the small REST correction that selects strategic merge for built-in object patches and JSON Patch for operation lists. Cover those media types and asynchronous YAML creation with request-level compatibility tests.
af93dd7 to
325ae7c
Compare
|
@tamird thanks for the PR, do you know whether the import latency issue reported in tomplus/kubernetes_asyncio#293 is resolved with the new openapi generator? |
|
could you also please take a look at the failure tests? https://github.com/kubernetes-client/python/actions/runs/29850863235/job/88758260386?pr=2631 |
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 PR moves the synchronous client to the modern
pythonbackend:modern generated type information;
py.typed;modern generated API; and
body-aware PATCH media-type correction.
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:
The paired generator migration is
kubernetes-client/gen#305. It selects the
released OpenAPI Generator v7.24.0, which contains the required legacy
compatibility and API-key-prefix fixes. The generated provenance records
the release tag and resolved commit 203d4867.
This changes synchronous generation only. The async client remains on
its existing generator path and should be regenerated separately; until
then,
sixremains an async requirement.Legacy
async_req=Truestill returns anApplyResultconsumed with.get(), and_preload_content=Falsereturns the raw response.Ordinary return annotations intentionally describe the default call:
Watch reflects them to select event models. The generator rationale is
OpenAPITools/openapi-generator#24300.
The initial release render was produced by the normal
scripts/update-client.shDocker path inhttps://github.com/tamird/kubernetes-python/actions/runs/29785873376.
Until the paired generator PR merges, reproduce it with that generator
branch checked out locally:
The previously published generated head passes the fork's Python
3.10-3.14 lint and test matrix:
https://github.com/tamird/kubernetes-python/actions/runs/29790431747.
Does this PR introduce a user-facing change?
Additional documentation: