[WIP] Switches to using python-experimental generator for client generation
What type of PR is this?
What this PR does / why we need it:
This PR switches to using python-experimental generator and openapi-generator v6.1.0 Please do not review this PR into I move it out of WIP/Draft State This PR updates the python client from the python generator to the python-experimental generator which has:
- type hints everywhere
- more robust composition(oneOf/anyOf/allOf/not) support
- payload someProp case used rather than python some_prop used to ensure compliance when imposing json schema keywords like properties/additionalProperties/composition. This allows a payload to contain the separate keys someProp and some_prop
- supports newer openapi features like handling of multiple request body content types and response body content types
I am seeking feedback from your project on how you feel about using the code generated from the python-experimental generator.
Which issue(s) this PR fixes:
Fixes #
- https://github.com/kubernetes-client/python/issues/1846
- https://github.com/kubernetes-client/python/issues/1421
- https://github.com/kubernetes-client/python/issues/1032
Special notes for your reviewer:
I am seeking feedback from your project on how you feel about using the code generated from the python-experimental generator.
Does this PR introduce a user-facing change?
This will require changes to how users integrate with the client.
A migration guide is included which shows what needs to be updated here
https://github.com/spacether/kube_python/tree/feat_switches_to_python_exp_client/kubernetes#migration-from-other-generators-like-python-and-python-legacy
Min allowed python version is 3.9
- Reviewer note: if you need a lower version I think that I could switch down to the 3.8 feature set because I need typing.overload and TypedDict
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
@spacether: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: spacether / name: Justin Black (de09cfa02bb53ec96590af268fe4459a925ca33a, 975f7286715fe6319e628c588a8a016b2046c328)
Welcome @spacether!
It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-client/python has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
i think we should not be using the experimental generator. please file a PR to use the official generator release.
@yliaog I just updated this PR to use the official 6.2.0 python generator
@yliaog can you or others review this PR? Do I need to do anything else?
could you please squash the commits? I'll take a look afterwards. Thanks.
@yliaog just squashed them into one commit now
https://github.com/spacether/kube_python/tree/feat_switches_to_python_exp_client/kubernetes#migration-from-other-generators-like-python-and-python-legacy
so this PR introduces breaking change? for breaking change, we need to solicit community feedback.
also it's better to split the PR into at least two commits, one commit for generated files, the other commit is for the manual edited files.
https://github.com/spacether/kube_python/tree/feat_switches_to_python_exp_client/kubernetes#migration-from-other-generators-like-python-and-python-legacy
so this PR introduces breaking change? for breaking change, we need to solicit community feedback.
also it's better to split the PR into at least two commits, one commit for generated files, the other commit is for the manual edited files.
Yes the updated client has breaking changes versus the old ones. I have not manually edited files. Which files need to be manually edited/where in this code base uses the client? How do we solicit community feedback?
https://github.com/kubernetes-client/gen/tree/master/openapi needs manual update?
please send email to: [email protected]
file an issue similar to: https://github.com/kubernetes-client/python/issues/974
My plan is to wait until 6.2.1 is released to get community feedback
sounds good. thanks.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: spacether
Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval by writing /assign @yliaog in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Just posted an email in https://groups.google.com/a/kubernetes.io/g/dev which looks like the newest google group to use
@spacether Could you update examples/ and e2e tests?
@tomplus can you help me with my tox requirement installation?
I have added the needed dependencies to requirements.txt, but they are not being picked up when installing with tox. What am I missing?
Note: pip install -e . correctly installs the requirements
@spacether: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Any update on this? openapi-generator v6.3.0 is released already.
I need help getting tox working. Until someone helps this is stalled. Also openapi-generator has announced that the current python generator will be replaced with the python-nextgen generator in v 7.0.0
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale