diff --git a/.tito/packages/python-openshift b/.tito/packages/python-openshift index 2e94fa72..18bb0ab8 100644 --- a/.tito/packages/python-openshift +++ b/.tito/packages/python-openshift @@ -1 +1 @@ -0.6.1-10 ./ +0.6.4-2 ./ diff --git a/.tito/releasers.conf b/.tito/releasers.conf index 66358882..2b4c815d 100644 --- a/.tito/releasers.conf +++ b/.tito/releasers.conf @@ -13,18 +13,6 @@ remote_location = http://repos.fedorapeople.org/asb/ copr_options = --timeout 600 builder.test = 1 -[asb-brew-36] +[asb-brew] releaser = tito.release.DistGitReleaser -branches = rhaos-3.6-asb-rhel-7 - -[asb-brew-37] -releaser = tito.release.DistGitReleaser -branches = rhaos-3.7-asb-rhel-7 - -[asb-brew-38] -releaser = tito.release.DistGitReleaser -branches = rhaos-3.8-asb-rhel-7 - -[asb-brew-39] -releaser = tito.release.DistGitReleaser -branches = rhaos-3.9-asb-rhel-7 +branches = rhaos-3.11-asb-rhel-7 diff --git a/.travis.yml b/.travis.yml index f271e99f..d3a5413c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,19 +8,14 @@ python: - '2.7' - '3.5' env: -- TEST_SUITE=test OPENSHIFT_VERSION=latest +- TEST_SUITE=test OPENSHIFT_VERSION=3.11 - TEST_SUITE=test OPENSHIFT_VERSION=3.7 -- TEST_SUITE=test OPENSHIFT_VERSION=3.6 -- TEST_SUITE=test OPENSHIFT_VERSION=1.5 -- TEST_SUITE=generate script: tox install: - pip install tox-travis coveralls after_success: - coveralls jobs: - allow_failures: - - env: TEST_SUITE=generate include: - stage: lint python: '2.7' @@ -28,13 +23,13 @@ jobs: - pip install tox-travis script: tox -e py27-lint env: - - TEST_SUITE=lint OPENSHIFT_VERSION=latest + - TEST_SUITE=lint OPENSHIFT_VERSION=3.11 - python: '3.5' install: - pip install tox-travis script: tox -e py35-lint env: - - TEST_SUITE=lint OPENSHIFT_VERSION=latest + - TEST_SUITE=lint OPENSHIFT_VERSION=3.11 - stage: deploy script: skip deploy: @@ -53,5 +48,7 @@ jobs: stages: - lint - test -- deploy -- test-deploy +- name: deploy + if: (tag is present) and (type = push) +- name: test-deploy + if: (tag is present) and (type = push) diff --git a/openshift/README.md b/openshift/README.md index ca560144..23216085 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -4,7 +4,7 @@ OpenShift provides builds, application lifecycle, image content management, and This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: latest -- Package version: 0.6.0 +- Package version: 0.6.4 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. diff --git a/openshift/__init__.py b/openshift/__init__.py index bba4ef64..a4b80e9d 100644 --- a/openshift/__init__.py +++ b/openshift/__init__.py @@ -18,5 +18,5 @@ # Do not edit these constants. They will be updated automatically # by scripts/update-client.sh. -__version__ = "0.6.0" +__version__ = "0.6.4" __k8s_client_version__ = "6.0.0" diff --git a/openshift/client/api_client.py b/openshift/client/api_client.py index 2ea5706c..ec710157 100644 --- a/openshift/client/api_client.py +++ b/openshift/client/api_client.py @@ -11,7 +11,7 @@ class ApiClient(K8sApiClient): def _ApiClient__deserialize(self, data, klass): if klass == 'RuntimeRawExtension': - data = {'Raw': b64encode(json.dumps(data))} + data = {'Raw': b64encode(json.dumps(data).encode()).decode()} try: return super(ApiClient, self).__deserialize(data, klass) except AttributeError: diff --git a/openshift/dynamic/client.py b/openshift/dynamic/client.py index d2b9f533..7e1c5f46 100755 --- a/openshift/dynamic/client.py +++ b/openshift/dynamic/client.py @@ -3,6 +3,7 @@ import sys import json from functools import partial +from six import PY2 import yaml from pprint import pformat @@ -41,10 +42,14 @@ def serialize(resource, response): try: return ResourceInstance(resource, load_json(response)) except ValueError: - return response.data.decode() + if PY2: + return response.data + return response.data.decode('utf8') def load_json(response): - return json.loads(response.data.decode()) + if PY2: + return json.loads(response.data) + return json.loads(response.data.decode('utf8')) class DynamicClient(object): diff --git a/python-openshift.spec b/python-openshift.spec index 591cb756..8a1f415f 100644 --- a/python-openshift.spec +++ b/python-openshift.spec @@ -3,9 +3,9 @@ %global library openshift Name: python-%{library} -Version: 0.6.1 -Release: 10%{?dist} -Summary: Python client for the OpenShift API +Version: 0.6.4 +Release: 2%{?dist} +Summary: Python client for the OpenShift API License: MIT URL: https://github.com/openshift/openshift-restclient-python Source0: https://github.com/openshift/openshift-restclient-python/python-openshift-%{version}.tar.gz @@ -13,7 +13,7 @@ BuildArch: noarch Epoch: 1 %package -n python2-%{library} -Summary: Python client for the OpenShift API +Summary: Python client for the OpenShift API %{?python_provide:%python_provide python2-%{library}} BuildRequires: python2-devel @@ -34,7 +34,7 @@ Python client for the kubernetes API. %if 0%{?with_python3} %package -n python3-%{library} -Summary: Python client for the OpenShift API +Summary: Python client for the OpenShift API %if 0%{?rhel} %{?python_provide:%python_provide python%{python3_pkgversion}-%{library}} %else @@ -70,11 +70,11 @@ Requires: python3-six %endif %description -n python3-%{library} -Python client for the OpenShift API +Python client for the OpenShift API %endif # with_python3 %description -Python client for the OpenShift API +Python client for the OpenShift API %prep %autosetup -S git @@ -131,6 +131,24 @@ sed -i -e "s/extract_requirements('requirements.txt')/REQUIRES/g" setup.py %endif # with_python3 %changelog +* Thu May 28 2020 jesus m. rodriguez 0.6.4-2 +- Resync changelog with rel-0.7 and update version (jesusr@redhat.com) +- Bump version to 0.6.4 (fabian@fabianism.us) +- py3 test fix (#330) (fabian@fabianism.us) +- Pin more requirements (fabian@fabianism.us) +- Reduce build matrix (fabian@fabianism.us) +- Do not decode response data in Python2 (#329) (openshift-cherrypick-robot@redhat.com) +- Update tests and pin dependencies to prevent irrelevant failures (fabian@fabianism.us) +- Fix version pin to kubernetes 6.0.0, bump version (fabian@fabianism.us) +* Mon Aug 06 2018 David Zager 0.6.2-12 +- Fix decode issue (#192) (lostonamountain@gmail.com) +- b64encode expects bytes not string (fridolin@redhat.com) +- Update releasers for 3.11 (david.j.zager@gmail.com) + +* Mon Jul 23 2018 David Zager 0.6.2-11 +- include version update script (fabian@fabianism.us) +- Version bump to 0.6.2 (fabian@fabianism.us) + * Thu Jul 05 2018 David Zager 0.6.1-10 - Install openshift.dynamic in RPM (#180) (dzager@redhat.com) @@ -208,7 +226,7 @@ sed -i -e "s/extract_requirements('requirements.txt')/REQUIRES/g" setup.py (ceridwen@users.noreply.github.com) * Fri Nov 03 2017 Jason Montleon 0.3.4-2 -- Update version +- Update version * Fri Nov 03 2017 Jason Montleon 0.3.3-8 - Bug 1508969 - Add foreground propagation policy (david.j.zager@gmail.com) @@ -237,7 +255,7 @@ sed -i -e "s/extract_requirements('requirements.txt')/REQUIRES/g" setup.py - make source name match package name * Fri Oct 06 2017 Jason Montleon 0.3.2-2 -- Fix source name +- Fix source name * Fri Oct 06 2017 Jason Montleon 0.3.2-1 - new package built with tito diff --git a/requirements.txt b/requirements.txt index f5e723ad..8d2b3fa6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ dictdiffer jinja2 -kubernetes >= 6.0.0 +kubernetes == 6.0.0 python-string-utils ruamel.yaml >= 0.15 six diff --git a/scripts/constants.py b/scripts/constants.py index 948280fb..77b9d457 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.6.1" +CLIENT_VERSION = "0.6.4" KUBERNETES_CLIENT_VERSION = "6.0.0" # Name of the release package diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 0261454c..bf85429b 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -1,5 +1,6 @@ set -x SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") +PACKAGE_NAME=$(python "${SCRIPT_ROOT}/constants.py" PACKAGE_NAME) SOURCE_ROOT="${SCRIPT_ROOT}/../" CLIENT_ROOT="${SOURCE_ROOT}/${PACKAGE_NAME}" CLIENT_VERSION=$(python "${SCRIPT_ROOT}/constants.py" CLIENT_VERSION) diff --git a/scripts/update_versions.sh b/scripts/update_versions.sh new file mode 100755 index 00000000..555702a5 --- /dev/null +++ b/scripts/update_versions.sh @@ -0,0 +1,10 @@ +SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") +SOURCE_ROOT="${SCRIPT_ROOT}/../" +PACKAGE_NAME=$(python "${SCRIPT_ROOT}/constants.py" PACKAGE_NAME) +CLIENT_ROOT="${SOURCE_ROOT}/${PACKAGE_NAME}" +CLIENT_VERSION=$(python "${SCRIPT_ROOT}/constants.py" CLIENT_VERSION) +set -x +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/^- Package version: .*/- Package version: ${CLIENT_VERSION}/" "${CLIENT_ROOT}/README.md" diff --git a/setup.py b/setup.py index 9004c284..86354bb0 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.6.1" +CLIENT_VERSION = "0.6.4" PACKAGE_NAME = "openshift" DEVELOPMENT_STATUS = "3 - Alpha" diff --git a/test-requirements.txt b/test-requirements.txt index 30c02dfc..5207a290 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ coverage docker ~= 2.1.0 -flake8 +flake8 == 3.5.0 pytest < 3.3 -pytest-cov +pytest-cov==2.5.1 PyYAML dictdiffer diff --git a/test/functional/test_examples.py b/test/functional/test_examples.py index 0640925b..0a609ad0 100644 --- a/test/functional/test_examples.py +++ b/test/functional/test_examples.py @@ -123,7 +123,7 @@ def replace_params(self, project, object_name): def dependencies(self, project, auth): dependencies = [] for dependency in self.tasks.get('dependencies', []): - resource_name, params = dependency.items()[0] + resource_name, params = list(dependency.items())[0] api, api_version, kind = resource_name.split('_') if api == 'k8s': ansible_helper = KubernetesAnsibleModuleHelper(api_version, kind, debug=True, reset_logfile=False, **auth) diff --git a/tox.ini b/tox.ini index dba79764..c6843d14 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py{27,35}-{lint} py{27,35}-generate - py{27,35}-openshift{latest,37,36,15,14,13}-test + py{27,35}-openshift{latest,311,37,36,15,14,13}-test [testenv] usedevelop = True @@ -11,12 +11,13 @@ setenv = openshift14: openshift_version=v1.4.1 openshift15: openshift_version=v1.5.1 openshift36: openshift_version=v3.6.0 - openshift37: openshift_version=v3.7.0-alpha.1 + openshift37: openshift_version=v3.7.0 + openshift311: openshift_version=v3.11.0 deps = -rrequirements.txt -rtest-requirements.txt - py35-lint: flake8-bugbear + py35-lint: flake8-bugbear==18.8.0 whitelist_externals = /bin/bash @@ -61,6 +62,7 @@ TEST_SUITE = generate: generate OPENSHIFT_VERSION = latest: openshiftlatest + 3.11: openshift311 3.7: openshift37 3.6: openshift36 1.5: openshift15