-
Notifications
You must be signed in to change notification settings - Fork 152
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
add script to create kubernetes_asyncio python client #60
add script to create kubernetes_asyncio python client #60
Conversation
openapi/python-asyncio.sh
Outdated
@@ -0,0 +1,99 @@ | |||
#!/bin/bash | |||
|
|||
# Copyright 2017 The Kubernetes Authors. |
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.
nit: 2018
openapi/python-asyncio.sh
Outdated
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage:" | ||
echo " python.sh OUTPUT_DIR SETTING_FILE_PATH" |
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.
nit: python-asyncio.sh
openapi/python-asyncio.sh
Outdated
# workaround https://github.com/swagger-api/swagger-codegen/pull/8204 | ||
# + closing session | ||
# + support application/strategic-merge-patch+json | ||
echo '21a22,23 |
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.
Do you really want to inline the patch here? I think it'd be cleaner to check in the patch file.
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.
Not really, moved to separated file.
openapi/python-asyncio.sh
Outdated
> raise ApiException(http_resp=r)' | patch "${OUTPUT_DIR}/client/rest.py" | ||
|
||
# fix imports | ||
find "${OUTPUT_DIR}/client/" -type f -name \*.py -exec sed -i 's/import client\./import kubernetes_asyncio.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.
There's a certain amount of duplication here, not sure if it's worth extracting into a shared file, but worth considering...
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.
I can roll these lines to one-liner with gawk probably but for me it's more readable now and I can easily execute it step-by-step. python.sh
has similar find/sed commands but with different name of package.
Sorry for the delay here, some comments, should be straight-forward to get this checked in. |
LGTM. |
Merging. cc @mbohlool in case he has any concerns, we can always revert. |
Script and configuration needed to create the new python asynchronous client. More information here: kubernetes-client/python#323