From 85713b3b284e5972cdc08e787edff34f4ff574e8 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 24 Feb 2021 16:46:25 -0500 Subject: [PATCH 1/9] Bump version to 0.12.0rc1 --- openshift/__init__.py | 4 ++-- python-openshift.spec | 2 +- scripts/constants.py | 4 ++-- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openshift/__init__.py b/openshift/__init__.py index c40d6957..40f6b987 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -14,5 +14,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-version.sh. -__version__ = "0.10.0dev1" -__k8s_client_version__ = "9.0.0" +__version__ = "0.12.0rc1" +__k8s_client_version__ = "12.0" diff --git a/python-openshift.spec b/python-openshift.spec index 76f94435..c7ee35e5 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.10.0dev1 +Version: 0.12.0rc1 Release: 1%{?dist} Summary: Python client for the OpenShift API License: ASL 2.0 diff --git a/scripts/constants.py b/scripts/constants.py index 8c22e5e8..d18e72c0 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -23,8 +23,8 @@ # client version for packaging and releasing. It can # be different than SPEC_VERSION. -CLIENT_VERSION = "0.10.0dev1" -KUBERNETES_CLIENT_VERSION = "10.0.1" +CLIENT_VERSION = "0.12.0rc1" +KUBERNETES_CLIENT_VERSION = "12.0" # Name of the release package PACKAGE_NAME = "openshift" diff --git a/setup.py b/setup.py index d2b794c1..857bf067 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "0.10.0dev1" +CLIENT_VERSION = "0.12.0rc1" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" From d7afd1d2ae2fd5291799c4f4f4175606d4fe7125 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 25 Feb 2021 11:37:40 -0500 Subject: [PATCH 2/9] Use newer python version for releasing to pypi (#395) * Pin kube dependency properly * Use python3 instead of 2 for pushing to pypi --- .travis.yml | 2 ++ requirements.txt | 2 +- scripts/update-version.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f1f2b34..61fa8329 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ jobs: - TEST_SUITE=lint OPENSHIFT_VERSION=latest - stage: deploy script: skip + python: '3.5' deploy: provider: pypi user: openshift @@ -49,6 +50,7 @@ jobs: repo: openshift/openshift-restclient-python condition: "$TRAVIS_TAG =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+(([ab]|dev|rc)[0-9]+)?$" - stage: test-deploy + python: '3.5' script: python -c "import openshift ; print(openshift.__version__)" install: - pip install openshift diff --git a/requirements.txt b/requirements.txt index ab2e4c80..2984992d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jinja2 -kubernetes +kubernetes ~= 12.0 python-string-utils ruamel.yaml six diff --git a/scripts/update-version.sh b/scripts/update-version.sh index c6010dfa..d166dcf3 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -9,6 +9,6 @@ echo "--- updating version information..." sed -i'' "s/^CLIENT_VERSION = .*/CLIENT_VERSION = \\\"${CLIENT_VERSION}\\\"/" "${SCRIPT_ROOT}/../setup.py" sed -i'' "s/^__version__ = .*/__version__ = \\\"${CLIENT_VERSION}\\\"/" "${CLIENT_ROOT}/__init__.py" sed -i'' "s/^Version:.*/Version: ${CLIENT_VERSION}/" "${SCRIPT_ROOT}/../python-openshift.spec" -sed -i'' "s/^kubernetes ~= .*/kubernetes ~= ${KUBERNETES_CLIENT_VERSION}/" "${SCRIPT_ROOT}/../requirements.txt" +sed -i'' "s/^kubernetes.*/kubernetes ~= ${KUBERNETES_CLIENT_VERSION}/" "${SCRIPT_ROOT}/../requirements.txt" sed -i'' "s/^__k8s_client_version__ = .*/__k8s_client_version__ = \\\"${KUBERNETES_CLIENT_VERSION}\\\"/" "${CLIENT_ROOT}/__init__.py" sed -i'' "s/^kubernetes .=.*/kubernetes ~= ${KUBERNETES_CLIENT_VERSION}/" ${SOURCE_ROOT}/requirements.txt From 0255340cf3965b5c2f7d59c37d8ebe4678e477ef Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 25 Feb 2021 11:38:21 -0500 Subject: [PATCH 3/9] Bump to rc2 --- openshift/__init__.py | 2 +- python-openshift.spec | 2 +- scripts/constants.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/__init__.py b/openshift/__init__.py index 40f6b987..1f317267 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -14,5 +14,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-version.sh. -__version__ = "0.12.0rc1" +__version__ = "0.12.0rc2" __k8s_client_version__ = "12.0" diff --git a/python-openshift.spec b/python-openshift.spec index c7ee35e5..9e9b3607 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.12.0rc1 +Version: 0.12.0rc2 Release: 1%{?dist} Summary: Python client for the OpenShift API License: ASL 2.0 diff --git a/scripts/constants.py b/scripts/constants.py index d18e72c0..a607cbeb 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -23,7 +23,7 @@ # client version for packaging and releasing. It can # be different than SPEC_VERSION. -CLIENT_VERSION = "0.12.0rc1" +CLIENT_VERSION = "0.12.0rc2" KUBERNETES_CLIENT_VERSION = "12.0" # Name of the release package diff --git a/setup.py b/setup.py index 857bf067..d2f66015 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "0.12.0rc1" +CLIENT_VERSION = "0.12.0rc2" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" From 1a13c6a026ca5f45c336baa27416766b0f120e5c Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Thu, 25 Feb 2021 10:13:33 -0800 Subject: [PATCH 4/9] Move travis from 3.5 to 3.8 (#397) Co-authored-by: Fabian von Feilitzsch --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61fa8329..37723917 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ cache: language: python python: - '2.7' -- '3.5' +- '3.8' env: global: - COVERALLS_PARALLEL=true @@ -31,7 +31,7 @@ jobs: script: tox -e py27-lint env: - TEST_SUITE=lint OPENSHIFT_VERSION=latest - - python: '3.5' + - python: '3.8' install: - pip install tox-travis script: tox -e py35-lint @@ -39,7 +39,7 @@ jobs: - TEST_SUITE=lint OPENSHIFT_VERSION=latest - stage: deploy script: skip - python: '3.5' + python: '3.8' deploy: provider: pypi user: openshift @@ -50,7 +50,7 @@ jobs: repo: openshift/openshift-restclient-python condition: "$TRAVIS_TAG =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+(([ab]|dev|rc)[0-9]+)?$" - stage: test-deploy - python: '3.5' + python: '3.8' script: python -c "import openshift ; print(openshift.__version__)" install: - pip install openshift From 06ee8b93baf4fa43341605a8c87c43d51e25f360 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Thu, 25 Feb 2021 14:06:49 -0500 Subject: [PATCH 5/9] Bump version to 0.12.0 --- openshift/__init__.py | 2 +- python-openshift.spec | 2 +- scripts/constants.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/__init__.py b/openshift/__init__.py index 1f317267..49fe7b7d 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -14,5 +14,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-version.sh. -__version__ = "0.12.0rc2" +__version__ = "0.12.0" __k8s_client_version__ = "12.0" diff --git a/python-openshift.spec b/python-openshift.spec index 9e9b3607..705ef789 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.12.0rc2 +Version: 0.12.0 Release: 1%{?dist} Summary: Python client for the OpenShift API License: ASL 2.0 diff --git a/scripts/constants.py b/scripts/constants.py index a607cbeb..35a00d2b 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -23,7 +23,7 @@ # client version for packaging and releasing. It can # be different than SPEC_VERSION. -CLIENT_VERSION = "0.12.0rc2" +CLIENT_VERSION = "0.12.0" KUBERNETES_CLIENT_VERSION = "12.0" # Name of the release package diff --git a/setup.py b/setup.py index d2f66015..cc5e3751 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "0.12.0rc2" +CLIENT_VERSION = "0.12.0" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" From b652544947a64e07f1dd55b7a35979f65ad28170 Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Tue, 22 Jun 2021 09:04:38 -0700 Subject: [PATCH 6/9] Add an option to provide "Accept" header to client request (#408) Signed-off-by: Nir Argaman Co-authored-by: Nir Argaman --- openshift/dynamic/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/dynamic/client.py b/openshift/dynamic/client.py index 000af480..f7dc154c 100644 --- a/openshift/dynamic/client.py +++ b/openshift/dynamic/client.py @@ -186,7 +186,7 @@ def watch(self, resource, namespace=None, name=None, label_selector=None, field_ yield event @meta_request - def request(self, method, path, body=None, **params): + def request(self, method, path, body=None, accept_header=None, **params): if not path.startswith('/'): path = '/' + path @@ -217,7 +217,7 @@ def request(self, method, path, body=None, **params): form_params = [] local_var_files = {} # HTTP header `Accept` - header_params['Accept'] = self.client.select_header_accept([ + header_params['Accept'] = accept_header or self.client.select_header_accept([ 'application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf' From 5dd23b8c566abb2e5fcaf20fa9decaca4d0c9341 Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Tue, 22 Jun 2021 21:12:50 -0700 Subject: [PATCH 7/9] Handle header_params same as upstream (#410) Co-authored-by: Fabian von Feilitzsch --- openshift/dynamic/client.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/openshift/dynamic/client.py b/openshift/dynamic/client.py index f7dc154c..3b80b972 100644 --- a/openshift/dynamic/client.py +++ b/openshift/dynamic/client.py @@ -186,7 +186,7 @@ def watch(self, resource, namespace=None, name=None, label_selector=None, field_ yield event @meta_request - def request(self, method, path, body=None, accept_header=None, **params): + def request(self, method, path, body=None, **params): if not path.startswith('/'): path = '/' + path @@ -216,12 +216,14 @@ def request(self, method, path, body=None, accept_header=None, **params): header_params = params.get('header_params', {}) form_params = [] local_var_files = {} - # HTTP header `Accept` - header_params['Accept'] = accept_header or self.client.select_header_accept([ - 'application/json', - 'application/yaml', - 'application/vnd.kubernetes.protobuf' - ]) + + # Checking Accept header. + new_header_params = dict((key.lower(), value) for key, value in header_params.items()) + if not 'accept' in new_header_params: + header_params['Accept'] = self.client.select_header_accept([ + 'application/json', + 'application/yaml', + ]) # HTTP header `Content-Type` if params.get('content_type'): From 108a120e333a7b0e46c0672df9225c07d84a9a26 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Wed, 23 Jun 2021 12:38:52 -0400 Subject: [PATCH 8/9] bump version --- openshift/__init__.py | 2 +- python-openshift.spec | 2 +- scripts/constants.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/__init__.py b/openshift/__init__.py index 49fe7b7d..d232613a 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -14,5 +14,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-version.sh. -__version__ = "0.12.0" +__version__ = "0.12.1" __k8s_client_version__ = "12.0" diff --git a/python-openshift.spec b/python-openshift.spec index 705ef789..e7e4800f 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.12.0 +Version: 0.12.1 Release: 1%{?dist} Summary: Python client for the OpenShift API License: ASL 2.0 diff --git a/scripts/constants.py b/scripts/constants.py index 35a00d2b..f08898c3 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -23,7 +23,7 @@ # client version for packaging and releasing. It can # be different than SPEC_VERSION. -CLIENT_VERSION = "0.12.0" +CLIENT_VERSION = "0.12.1" KUBERNETES_CLIENT_VERSION = "12.0" # Name of the release package diff --git a/setup.py b/setup.py index cc5e3751..daf689d7 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -CLIENT_VERSION = "0.12.0" +CLIENT_VERSION = "0.12.1" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" From 8cd3fd9c06b621b344317d9c45ea2fab6e3b9502 Mon Sep 17 00:00:00 2001 From: Wong Hoi Sing Edison Date: Wed, 17 Nov 2021 14:50:19 +0800 Subject: [PATCH 9/9] Upgrade `kubernetes >= 12.0` With master branch we simply pin dependency with `kubernetes`, but now branch `release-0.12` having a hard limit with `kubernetes ~= 12.0`. BTW, https://github.com/kubernetes-client/python/releases/tag/v12.0.1 was released on 2020-11-10, where today least release is https://github.com/kubernetes-client/python/releases/tag/v19.15.0. This PR remove the upper limit with `kubernetes >= 12.0`. Signed-off-by: Wong Hoi Sing Edison --- .travis.yml | 42 +++++++++++++++++++----------------------- requirements.txt | 2 +- setup.py | 7 ++++--- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37723917..60d67198 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ sudo: required services: -- docker + - docker cache: -- pip + - pip language: python python: -- '2.7' -- '3.8' + - '3.9' + - '3.8' + - '3.7' + - '3.6' env: global: - COVERALLS_PARALLEL=true @@ -19,27 +21,21 @@ env: - TEST_SUITE=dynamic-functional OPENSHIFT_VERSION=latest script: tox install: -- pip install tox-travis coveralls + - pip install tox-travis coveralls after_success: -- coveralls + - coveralls jobs: include: - stage: lint - python: '2.7' + python: '3.9' install: - - pip install tox-travis - script: tox -e py27-lint - env: - - TEST_SUITE=lint OPENSHIFT_VERSION=latest - - python: '3.8' - install: - - pip install tox-travis + - pip install tox-travis script: tox -e py35-lint env: - - TEST_SUITE=lint OPENSHIFT_VERSION=latest + - TEST_SUITE=lint OPENSHIFT_VERSION=latest - stage: deploy script: skip - python: '3.8' + python: '3.9' deploy: provider: pypi user: openshift @@ -50,16 +46,16 @@ jobs: repo: openshift/openshift-restclient-python condition: "$TRAVIS_TAG =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+(([ab]|dev|rc)[0-9]+)?$" - stage: test-deploy - python: '3.8' + python: '3.9' script: python -c "import openshift ; print(openshift.__version__)" install: - pip install openshift stages: -- lint -- test -- name: deploy - if: (tag is present) and (type = push) -- name: test-deploy - if: (tag is present) and (type = push) + - lint + - test + - name: deploy + if: (tag is present) and (type = push) + - name: test-deploy + if: (tag is present) and (type = push) notifications: webhooks: https://coveralls.io/webhook diff --git a/requirements.txt b/requirements.txt index 2984992d..d7d0d34a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jinja2 -kubernetes ~= 12.0 +kubernetes >= 12.0 python-string-utils ruamel.yaml six diff --git a/setup.py b/setup.py index daf689d7..2e5c2a55 100644 --- a/setup.py +++ b/setup.py @@ -61,10 +61,11 @@ def extract_requirements(filename): "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ], entry_points={ 'console_scripts': ['openshift-ansible-gen = openshift.ansiblegen.cli:commandline']