Regenerate the asyncio client with dependency-free lazy imports - #2647
Conversation
|
/kind feature — tamirdex |
|
/assign @yliaog |
|
@yliaog The Job-deletion end-to-end failure is fixed at its generator source in kubernetes-client/gen#306, which builds on the synchronous foundation in kubernetes-client/gen#305, and regenerated in a07ca37. Validation is green for Python 3.10–3.14 on that exact head: https://github.com/tamird/kubernetes-python/actions/runs/29979418887. The upstream validation and real-cluster end-to-end workflows cannot start until a repository maintainer approves the fork runs: https://github.com/kubernetes-client/python/actions/runs/29979421215 and https://github.com/kubernetes-client/python/actions/runs/29979421210. Could you approve them? The upstream end-to-end suite has not yet run on the corrected head. — tamirdex |
Python 3.10 raises TypeError when inspecting AsyncMock, preventing asynchronous Watch from falling back to the documented resource type. Treat unsupported signatures like missing annotations and add a regression covering the affected callable.
Autospec a real asynchronous API operation so watch tests expose the same inspectable callable signature as generated clients. Model aiohttp response close and release as synchronous methods, and restore direct return-type inspection without test-specific production behavior.
Kubernetes may return the deleted resource or Status for the same successful delete. Regenerate the asyncio APIs and their documentation from the corrected Swagger contract, including a real-HTTP Job deletion regression.
Generate the synchronous APIs and documentation from the same corrected Kubernetes deletion contract as the asyncio client. Cover deleted Job responses with a real-HTTP regression.
Update the canonical Kubernetes Swagger to describe individual deletion responses consistently with the regenerated synchronous and asyncio clients. Collection deletes and accurately typed resource responses remain unchanged.
86dab51 to
55ea200
Compare
|
@yliaog I rebased 55ea200 onto the now-merged #2652, so the asyncio client inherits the dependency-free synchronous generator, urllib3 security floor, and generator source recorded in kubernetes-client/gen#306. The asyncio output is unchanged; this is the existing eight-commit change on the current master. Fresh validation and end-to-end checks must run on this new head; successful checks on the previous head do not establish its result. [tamirdex] |
|
the PR description: "#2652 must land first because importing kubernetes.aio initializes the synchronous client." why is that? async client and sync client should be independent |
|
@yliaog The clients are independent. The sentence refers to Python package initialization: importing Lines 19 to 26 in 55ea200 kubernetes.aio modules: python/kubernetes/aio/__init__.py Lines 19 to 26 in 55ea200 The synchronous change has already merged, this branch is rebased onto it, and both validation and end-to-end checks now pass. My wording incorrectly made parent-package initialization sound like a dependency between the clients. [tamirdex] |
|
the import latency is on par $ git checkout master $ time python -c 'import kubernetes.aio.client; print(kubernetes.aio.client.file)' real 0m1.326s $ git checkout pr-2647 real 0m1.105s |
|
thanks for the PR /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tamird, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c01426a
into
kubernetes-client:master
|
@yliaog thanks for merging! Just a reminder to merge kubernetes-client/gen#306 so everything is consistent! |
|
Sure, approved kubernetes-client/gen#306 1c5984c can be reverted then, could you revert it? |
Regenerate
kubernetes.aiowith the OpenAPI Generator v7aiohttpbackend and dependency-free Python templates from OpenAPITools/openapi-generator#24402. The asynchronous and synchronous client implementations remain independent.Apply Kubernetes authentication, TLS, watch, WebSocket, and PATCH adaptations in the generator-owned postprocessing from kubernetes-client/gen#306, and remove twelve obsolete downstream patches for the v6 client.
The generated metadata records
7.25.0-SNAPSHOT;v7.24.0is the latest published release: https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.24.0. The remaining prerequisite is merging the generator change so this client can be reproduced from upstream./kind feature