From 8cb7c7a197d21aa2b93f6d38adb4e1936c5f0992 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 25 Jul 2023 14:27:46 -0400 Subject: [PATCH 1/5] drop py27 --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b9c365d..c9c597e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,13 +22,7 @@ jobs: python: '3.9' install: - pip install tox-travis - script: tox -e py27-lint - env: - - TEST_SUITE=lint - - python: '3.9' - install: - - pip install tox-travis - script: tox -e py35-lint + script: tox -e py39-lint env: - TEST_SUITE=lint - stage: deploy From 1dd14e9522f4b39255e82ad62763268ba1a085b4 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 25 Jul 2023 14:32:54 -0400 Subject: [PATCH 2/5] Fix linting --- openshift/helper/hashes.py | 4 ++-- tox.ini | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openshift/helper/hashes.py b/openshift/helper/hashes.py index 4df7dc5b..bc47f05e 100644 --- a/openshift/helper/hashes.py +++ b/openshift/helper/hashes.py @@ -30,11 +30,11 @@ def generate_hash(resource): resource['name'] = resource.get('metadata', {}).get('name', '') if resource['kind'] == 'ConfigMap': marshalled = marshal(sorted_dict(resource), ['data', 'kind', 'name']) - del(resource['name']) + del resource['name'] return encode(marshalled) if resource['kind'] == 'Secret': marshalled = marshal(sorted_dict(resource), ['data', 'kind', 'name', 'type']) - del(resource['name']) + del resource['name'] return encode(marshalled) raise NotImplementedError diff --git a/tox.ini b/tox.ini index d2139f62..bac50fee 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] envlist = + py310-lint py39-lint py39-openshift-unit @@ -9,6 +10,7 @@ deps = -rrequirements.txt -rtest-requirements.txt py39-lint: flake8-bugbear + py310-lint: flake8-bugbear whitelist_externals = /bin/bash From e3d9a267a1101ac65ec4dc2f427d9438696082b2 Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Tue, 25 Jul 2023 19:14:10 +0000 Subject: [PATCH 3/5] fix split call to handle apis of the format `a/b/c` (#440) Co-authored-by: dbasunag --- openshift/dynamic/discovery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/dynamic/discovery.py b/openshift/dynamic/discovery.py index 3c7cce3a..46b04700 100644 --- a/openshift/dynamic/discovery.py +++ b/openshift/dynamic/discovery.py @@ -130,7 +130,7 @@ def get_resources_for_api_version(self, prefix, group, version, preferred): resources_raw = list(filter(lambda resource: '/' not in resource['name'], resources_response)) subresources_raw = list(filter(lambda resource: '/' in resource['name'], resources_response)) for subresource in subresources_raw: - resource, name = subresource['name'].split('/') + resource, name = subresource['name'].split('/', 1) if not subresources.get(resource): subresources[resource] = {} subresources[resource][name] = subresource From 2d0c21f223f8032c19893fc2e49b66be7b63567f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 25 Jul 2023 15:15:51 -0400 Subject: [PATCH 4/5] Release 0.13.2 --- 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 cd557284..e1ff0719 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.13.1" +__version__ = "0.13.2" __k8s_client_version__ = "21.7.0" diff --git a/python-openshift.spec b/python-openshift.spec index ae17179d..ec944ae1 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.13.1 +Version: 0.13.2 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 6b6491ca..ff77f84b 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.13.1" +CLIENT_VERSION = "0.13.2" KUBERNETES_CLIENT_VERSION = "21.7.0" # Name of the release package diff --git a/setup.py b/setup.py index b563b6ed..0d0c56a9 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.13.1" +CLIENT_VERSION = "0.13.2" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" From 8354d02a535699e2e3879fd93ced3a5e56466503 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 25 Jul 2023 15:28:34 -0400 Subject: [PATCH 5/5] upgrade python version in CI to fix SSL for releases --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9c597e4..29c47cb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: - pip language: python python: -- '3.9' +- '3.10-dev' env: global: - COVERALLS_PARALLEL=true @@ -19,15 +19,15 @@ after_success: jobs: include: - stage: lint - python: '3.9' + python: '3.10-dev' install: - pip install tox-travis - script: tox -e py39-lint + script: tox -e py310-lint env: - TEST_SUITE=lint - stage: deploy script: skip - python: '3.9' + python: '3.10-dev' deploy: provider: pypi user: openshift @@ -38,7 +38,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.9' + python: '3.10-dev' script: python -c "import openshift ; print(openshift.__version__)" install: - pip install openshift