-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: switch python client to use openapi-generator #97
feat: switch python client to use openapi-generator #97
Conversation
CLIENT_LANGUAGE=python; \ | ||
CLEANUP_DIRS=(client/apis client/models docs test); \ | ||
CLEANUP_DIRS=(client/api client/apis client/models docs test); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sub-package is renamed from apis
to api
. This changes has been already introduced in swagger-codegen.
find "${OUTPUT_DIR}/test" -type f -name \*.py -exec sed -i 's/\bclient/kubernetes.client/g' {} + | ||
find "${OUTPUT_DIR}" -path "${OUTPUT_DIR}/base" -prune -o -type f -a -name \*.md -exec sed -i 's/\bclient/kubernetes.client/g' {} + | ||
find "${OUTPUT_DIR}" -path "${OUTPUT_DIR}/base" -prune -o -type f -a -name \*.md -exec sed -i 's/kubernetes.client-python/client-python/g' {} + | ||
|
||
# fix imports | ||
find "${OUTPUT_DIR}/client/" -type f -name \*.py -exec sed -i 's/import client\./import kubernetes.client./g' {} + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolute vs relative imports. It's not related to the openapi-generator too, the latest version of swagger-codegen uses absolute imports and here it's fixed by adding prefix kubernetes.
.
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
@yliaog @roycaihw please take a look, you can see generated code here: kubernetes-client/python#738 |
@tomplus I'm happy to merge this if/when it is ready to go, but I defer to other reviewers... |
/assign |
Thanks for putting this together! I looked at kubernetes-client/python#738 and it's pretty neat. I had some minor questions that aren't blocking, so /lgtm I'd like to try this for the next 1.15 alpha release :) |
/assign @brendandburns I tried picking this locally and the generated results look good. Could you approve this pull so we can generate using the upstream |
@brendandburns, could you add @roycaihw and @yliaog to the admin group of this repo, i think it is https://github.com/orgs/kubernetes-client/teams/gen-admins |
Sorry for the delay, please ping me on slack or email in the future. Happy to aad you to the admins, you need to file a PR with https://github.com/kubernetes/org /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, tomplus The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The Python will be generated by openapi-generator. I also prepared this PR: kubernetes-client/python#738 to show what changes will be introduced to the generated client. Unfortunately this client used very old version of swagger-codegen.
Ref: #93
PTAL: @yliaog @roycaihw @mbohlool @brendandburns