Skip to content
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

Merged
merged 4 commits into from
Jun 14, 2018

Conversation

tomplus
Copy link
Member

@tomplus tomplus commented May 20, 2018

Script and configuration needed to create the new python asynchronous client. More information here: kubernetes-client/python#323

@@ -0,0 +1,99 @@
#!/bin/bash

# Copyright 2017 The Kubernetes Authors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2018


if [ $# -ne 2 ]; then
echo "Usage:"
echo " python.sh OUTPUT_DIR SETTING_FILE_PATH"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: python-asyncio.sh

# workaround https://github.com/swagger-api/swagger-codegen/pull/8204
# + closing session
# + support application/strategic-merge-patch+json
echo '21a22,23
Copy link
Contributor

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.

Copy link
Member Author

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.

> 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' {} +
Copy link
Contributor

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...

Copy link
Member Author

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.

@brendandburns
Copy link
Contributor

Sorry for the delay here, some comments, should be straight-forward to get this checked in.

@brendandburns
Copy link
Contributor

LGTM.

@brendandburns
Copy link
Contributor

Merging. cc @mbohlool in case he has any concerns, we can always revert.

@brendandburns brendandburns merged commit 55f9ae0 into kubernetes-client:master Jun 14, 2018
@tomplus tomplus deleted the feat/python-asyncio branch October 14, 2018 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants