-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Travis configuration now does extra tag validation #1101
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
Travis configuration now does extra tag validation #1101
Conversation
Separate build matrix into 3 stages - verify-tag, test, and deploy - verify-tag compares the kubernetes.__version__ to $TRAVIS_TAG. Only runs on pushed tags - test runs the actual tests - deploy deploys the package to pypi. Only runs on pushed tags
/cc @palnabarun |
Travis doesn't seem to have picked this up, which I assume implies a major mistake on my end edit: The script started with |
@fabianvf Thank you for splitting the stages out. I was working on it on the side. :) |
.travis.yml
Outdated
- stage: verify-tag | ||
python: 3.7 | ||
script: | | ||
[ "v$(python -c 'import kubernetes ; print(kubernetes.__version__)')" == "${TRAVIS_TAG}" ] |
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.
We could also put in a check to make sure that the TRAVIS_TAG
obeys semver
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 was going to say that. This would, in turn, ensure that the version that we put in constants.py is also validated.
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.
LGTM!
python: 3.7 | ||
script: > | ||
[ "v$(python -c 'import kubernetes ; print(kubernetes.__version__)')" == "${TRAVIS_TAG}" ] && | ||
[[ "${TRAVIS_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(([ab]|dev|rc)[0-9]+)?$ ]] |
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.
👍
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabianvf, yliaog 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 |
@roycaihw would you mind doing another test with these changes, just to make sure it all works in the travis environment? Tested it out locally but you never know |
@fabianvf I checked out the latest revision of the config: https://github.com/kubernetes-client/python/commits/travis-pypi-experiment and tagged a new release
|
I think this is due to the package not being installed in the environment or some other dependency issue. When I ran it locally in a fresh virtual environment based on 3.7, it gave me this $ mkvirtualenv --python=/usr/bin/python3.7 py37-temp
Running virtualenv with interpreter /usr/bin/python3.7
Already using interpreter /usr/bin/python3.7
Using base prefix '/usr'
New python executable in /home/nabarun/.envs/py37-temp/bin/python3.7
Also creating executable in /home/nabarun/.envs/py37-temp/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/preactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/postactivate
virtualenvwrapper.user_scripts creating /home/nabarun/.envs/py37-temp/bin/get_env_details
$ python -c 'import kubernetes ; print(kubernetes.__version__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/__init__.py", line 19, in <module>
import kubernetes.client
File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/__init__.py", line 20, in <module>
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/api/__init__.py", line 6, in <module>
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi
File "/home/nabarun/c/kubernetes/kubernetes-client/python/kubernetes/client/api/admissionregistration_api.py", line 18, in <module>
import six
ModuleNotFoundError: No module named 'six' Getting the client version from $ python -c 'from scripts.constants import CLIENT_VERSION; print(CLIENT_VERSION)'
11.0.0-snapshot |
Separate build matrix into 3 stages - verify-tag, test, and deploy
kubernetes.__version__
to$TRAVIS_TAG
. Onlyruns on pushed tags