8000 Introducing __version__ variable by brejoc · Pull Request #318 · kubernetes-client/python · GitHub
[go: up one dir, main page]

Skip to content

Introducing __version__ variable #318

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

Merged
merged 2 commits into from
Aug 16, 2017
Merged

Conversation

brejoc
Copy link
Contributor
@brejoc brejoc commented Aug 10, 2017

With the gathered distribution information we are trying to fetch the version number for kubernetes.__version__.
Fixes #317

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 10, 2017
@brejoc
Copy link
Contributor Author
brejoc commented Aug 11, 2017

@mbohlool Could you please take a look here? I've signed the CLA, but the process seems to be broken. Linux Foundation helpdesk is just answering with canned answers. Is there a way to do this manually? Thanks!

@mbohlool
Copy link
Contributor

I don't think there is a way around it. More information along with individual's contact information here: https://github.com/kubernetes/community/blob/master/CLA.md

@mbohlool
Copy link
Contributor

You can also ask your question in this issue: kubernetes/kubernetes#27796

@brejoc
Copy link
Contributor Author
brejoc commented Aug 12, 2017

Bumping again for the CLA check.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 12, 2017
@mbohlool
Copy link
Contributor
mbohlool commented Aug 13, 2017

Thanks for the patch. I think this will work most of the time but we can hardcode the version as it only changes when we call scripts/update_client.sh. This line in scripts/update_client.sh hard-codes the version in setup.py file:

sed -i'' "s/^CLIENT_VERSION = .*/CLIENT_VERSION = \\\"${CLIENT_VERSION}\\\"/" "${SCRIPT_ROOT}/../setup.py"

it can do the same here too if you only add this line:

# The version is auto-updated. Please do not edit.
__version__ = None

and add this line to the update_client.sh script:

sed -i'' "s/^__version__ = .*/__version__ = \\\"${CLIENT_VERSION}\\\"/" "${CLIENT_ROOT}/__init__.py"

what do you think about this solution?

@brejoc
Copy link
Contributor Author
brejoc commented Aug 13, 2017

@mbohlool Since you've already got that in place, this is the way to go. I assume update-client.sh is invoked before every package generation?

@mbohlool
Copy link
Contributor

Yes. The process is explained in the release page.
I have just one comment. Otherwise it looks good.

@mbohlool
Copy link
Contributor

Would be nice if you can squash all commits into one then run update-client.sh script commit its changes separately. This will make sure everything works. If you saw changes to spec versions, that is expected. Commit those too.

@brejoc
Copy link
Contributor Author
brejoc commented Aug 15, 2017

Okay, I hope this was right. There where a lot of changed files coming from update-client.sh.

@mbohlool
Copy link
Contributor
mbohlool commented Aug 15, 2017

You probably need to do a rebase, then the changes will be much less as most of them are already in master. I would revert the auto-update commit, do a rebase and then run the updater again. That should give you a clean change.

brejoc added 2 commits August 16, 2017 08:11
Version information comes from scripts/constants.py and is hard-coded to
kubernetes/__init__py by scripts/update-client.sh.

__project__ is just hard-coded.

Fixes kubernetes-client#317
@brejoc
Copy link
Contributor Author
brejoc commented Aug 16, 2017

@mbohlool This looks much better!

@mbohlool
Copy link
Contributor

Thanks for bear with me :) This looks good.

@mbohlool mbohlool merged commit 01f6875 into kubernetes-client:master Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0