diff --git a/.travis.yml b/.travis.yml index 4f1f2b34..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.5' + - '3.9' + - '3.8' + - '3.7' + - '3.6' env: global: - COVERALLS_PARALLEL=true @@ -19,26 +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.5' - 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.9' deploy: provider: pypi user: openshift @@ -49,15 +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.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/openshift/__init__.py b/openshift/__init__.py index c40d6957..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.10.0dev1" -__k8s_client_version__ = "9.0.0" +__version__ = "0.12.1" +__k8s_client_version__ = "12.0" diff --git a/openshift/dynamic/client.py b/openshift/dynamic/client.py index 000af480..3b80b972 100644 --- a/openshift/dynamic/client.py +++ b/openshift/dynamic/client.py @@ -216,12 +216,14 @@ def request(self, method, path, body=None, **params): header_params = params.get('header_params', {}) form_params = [] local_var_files = {} - # HTTP header `Accept` - header_params['Accept'] = 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'): diff --git a/python-openshift.spec b/python-openshift.spec index 76f94435..e7e4800f 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -16,7 +16,7 @@ %endif Name: python-%{library} -Version: 0.10.0dev1 +Version: 0.12.1 Release: 1%{?dist} Summary: Python client for the OpenShift API License: ASL 2.0 diff --git a/requirements.txt b/requirements.txt index ab2e4c80..d7d0d34a 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/constants.py b/scripts/constants.py index 8c22e5e8..f08898c3 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.1" +KUBERNETES_CLIENT_VERSION = "12.0" # Name of the release package PACKAGE_NAME = "openshift" 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 diff --git a/setup.py b/setup.py index d2b794c1..2e5c2a55 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.1" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" @@ -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']