From 7c1a454c5c81bd9f5947fd97d5b035dc0295c246 Mon Sep 17 00:00:00 2001 From: mcepl <> Date: Tue, 21 Mar 2023 16:41:25 +0000 Subject: [PATCH] Update python-conu to version 1.0.0 / rev 3 via SR 1073107 https://build.opensuse.org/request/show/1073107 by user mcepl + dimstar_suse - do not require six - added patches fix https://github.com/user-cont/conu/issues/390 + python-conu-no-six.patch --- packages/p/python-conu/.files | Bin 177 -> 239 bytes packages/p/python-conu/.rev | 11 + .../p/python-conu/python-conu-no-six.patch | 293 ++++++++++++++++++ packages/p/python-conu/python-conu.changes | 8 + packages/p/python-conu/python-conu.spec | 12 +- 5 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 packages/p/python-conu/python-conu-no-six.patch diff --git a/packages/p/python-conu/.files b/packages/p/python-conu/.files index 09d8dda2306c9ae57e12a5fd68409e29987cae75..97bb11b78cc09f99a50a80b1dbebd2d0af1a4b79 100644 GIT binary patch literal 239 zcmYk$J8r{33 870735 + + 7ac56b570f917d466b53b97d0d417483 + 1.0.0 + + dimstar_suse + - do not require six +- added patches + fix https://github.com/user-cont/conu/issues/390 + + python-conu-no-six.patch + 1073107 + diff --git a/packages/p/python-conu/python-conu-no-six.patch b/packages/p/python-conu/python-conu-no-six.patch new file mode 100644 index 00000000000..6e3749c4fa8 --- /dev/null +++ b/packages/p/python-conu/python-conu-no-six.patch @@ -0,0 +1,293 @@ +Index: conu-1.0.0/conu.egg-info/requires.txt +=================================================================== +--- conu-1.0.0.orig/conu.egg-info/requires.txt ++++ conu-1.0.0/conu.egg-info/requires.txt +@@ -1,5 +1,4 @@ + requests +-six + docker + kubernetes==8.0.0 + pytest +Index: conu-1.0.0/conu/apidefs/container.py +=================================================================== +--- conu-1.0.0.orig/conu/apidefs/container.py ++++ conu-1.0.0/conu/apidefs/container.py +@@ -13,7 +13,7 @@ from conu.apidefs.image import Image + from conu.utils.http_client import HttpClient, get_url + + import requests +-from six.moves.urllib.parse import urlunsplit ++from urllib.parse import urlunsplit + from contextlib import contextmanager + + +Index: conu-1.0.0/conu/backend/buildah/image.py +=================================================================== +--- conu-1.0.0.orig/conu/backend/buildah/image.py ++++ conu-1.0.0/conu/backend/buildah/image.py +@@ -15,8 +15,6 @@ import logging + import os + import subprocess + +-import six +- + from conu.apidefs.backend import get_backend_tmpdir + from conu.apidefs.image import Image + from conu.apidefs.metadata import ImageMetadata +@@ -75,7 +73,7 @@ class BuildahImage(Image): + :param pull_policy: enum, strategy to apply for pulling the image + """ + super(BuildahImage, self).__init__(repository, tag=tag) +- if not isinstance(tag, (six.string_types, None.__class__)): ++ if not isinstance(tag, (str, None.__class__)): + raise ConuException("'tag' is not a string type") + if not isinstance(pull_policy, BuildahImagePullPolicy): + raise ConuException("'pull_policy' is not an instance of BuildahImagePullPolicy") +Index: conu-1.0.0/conu/backend/docker/image.py +=================================================================== +--- conu-1.0.0.orig/conu/backend/docker/image.py ++++ conu-1.0.0/conu/backend/docker/image.py +@@ -16,8 +16,6 @@ import subprocess + import enum + from tempfile import mkdtemp + +-import six +- + from kubernetes.client.rest import ApiException + + from conu.apidefs.metadata import ImageMetadata +@@ -110,7 +108,7 @@ class DockerImage(Image): + :param pull_policy: enum, strategy to apply for pulling the image + """ + super(DockerImage, self).__init__(repository, tag=tag) +- if not isinstance(tag, (six.string_types, None.__class__)): ++ if not isinstance(tag, (str, None.__class__)): + raise ConuException("'tag' is not a string type") + if not isinstance(pull_policy, DockerImagePullPolicy): + raise ConuException("'pull_policy' is not an instance of DockerImagePullPolicy") +Index: conu-1.0.0/conu/backend/podman/image.py +=================================================================== +--- conu-1.0.0.orig/conu/backend/podman/image.py ++++ conu-1.0.0/conu/backend/podman/image.py +@@ -15,8 +15,6 @@ import logging + import os + import subprocess + +-import six +- + from conu.apidefs.backend import get_backend_tmpdir + from conu.apidefs.image import Image + from conu.apidefs.metadata import ImageMetadata +@@ -61,7 +59,7 @@ class PodmanImage(Image): + :param pull_policy: enum, strategy to apply for pulling the image + """ + super(PodmanImage, self).__init__(repository, tag=tag) +- if not isinstance(tag, (six.string_types, None.__class__)): ++ if not isinstance(tag, (str, None.__class__)): + raise ConuException("'tag' is not a string type") + if not isinstance(pull_policy, PodmanImagePullPolicy): + raise ConuException("'pull_policy' is not an instance of PodmanImagePullPolicy") +Index: conu-1.0.0/conu/utils/filesystem.py +=================================================================== +--- conu-1.0.0.orig/conu/utils/filesystem.py ++++ conu-1.0.0/conu/utils/filesystem.py +@@ -14,9 +14,6 @@ import pwd + from conu.exceptions import ConuException + from conu.utils import run_cmd, is_selinux_disabled, setfacl_command_exists, chcon_command_exists + +-import six +- +- + logger = logging.getLogger(__name__) + + +@@ -85,14 +82,14 @@ class Directory(object): + self.facl_rules = facl_rules + + # os.chown wants int +- if isinstance(user_owner, six.string_types): ++ if isinstance(user_owner, str): + try: + self.owner = pwd.getpwnam(user_owner)[2] + except KeyError as ex: + raise ConuException("User %r not found, error message: %r" % (user_owner, ex)) + else: + self.owner = user_owner +- if isinstance(group_owner, six.string_types): ++ if isinstance(group_owner, str): + try: + self.group = pwd.getpwnam(group_owner)[3] + except KeyError as ex: +@@ -246,7 +243,7 @@ class Volume(object): + :param volume: tuple in one one of the following forms: target | source,target | source,target,mode + :return: instance of Volume + """ +- if isinstance(volume, six.string_types): ++ if isinstance(volume, str): + return Volume(target=volume) + elif len(volume) == 2: + return Volume(source=volume[0], +Index: conu-1.0.0/conu/utils/http_client.py +=================================================================== +--- conu-1.0.0.orig/conu/utils/http_client.py ++++ conu-1.0.0/conu/utils/http_client.py +@@ -4,7 +4,7 @@ + # SPDX-License-Identifier: MIT + # + from requests import Session +-from six.moves.urllib.parse import urlunsplit ++from urllib.parse import urlunsplit + + + def get_url(path, host, port, method="http"): +Index: conu-1.0.0/requirements.txt +=================================================================== +--- conu-1.0.0.orig/requirements.txt ++++ conu-1.0.0/requirements.txt +@@ -1,5 +1,4 @@ + requests +-six + docker + kubernetes==8.0.0 + pytest +Index: conu-1.0.0/tests/integration/test_buildah.py +=================================================================== +--- conu-1.0.0.orig/tests/integration/test_buildah.py ++++ conu-1.0.0/tests/integration/test_buildah.py +@@ -3,7 +3,6 @@ from __future__ import print_function, u + import subprocess + + import pytest +-from six import string_types + + from conu import ConuException, random_str + from conu.fixtures import buildah_backend +@@ -31,7 +30,7 @@ def test_buildah_image(buildah_backend): + assert "registry.fedoraproject.org/fedora-minimal:33" == str(image) + assert "BuildahImage(repository=%s, tag=%s)" % (FEDORA_MINIMAL_REPOSITORY, + FEDORA_MINIMAL_REPOSITORY_TAG) == repr(image) +- assert isinstance(image.get_id(), string_types) ++ assert isinstance(image.get_id(), str) + new_image = image.tag_image(tag="test") + assert new_image.is_present() + new_image.rmi(via_name=True) +@@ -55,7 +54,7 @@ def test_buildah_container(buildah_backe + assert "Config" in c.inspect() + assert c.get_id() == str(c) + assert repr(c) +- assert isinstance(c.get_id(), string_types) ++ assert isinstance(c.get_id(), str) + finally: + c.delete(force=True) + +Index: conu-1.0.0/tests/integration/test_docker.py +=================================================================== +--- conu-1.0.0.orig/tests/integration/test_docker.py ++++ conu-1.0.0/tests/integration/test_docker.py +@@ -30,7 +30,6 @@ from conu import \ + Directory + + from conu.backend.docker.skopeo import SkopeoTransport +-from six import string_types + + + @pytest.mark.parametrize("reference,result", [ +@@ -129,7 +128,7 @@ def test_image(): + assert "registry.fedoraproject.org/fedora-minimal:33" == str(image) + assert "DockerImage(repository=%s, tag=%s)" % (FEDORA_MINIMAL_REPOSITORY, + FEDORA_MINIMAL_REPOSITORY_TAG) == repr(image) +- assert isinstance(image.get_id(), string_types) ++ assert isinstance(image.get_id(), str) + new_image = image.tag_image(tag="test") + new_image.rmi(via_name=True) + +@@ -155,7 +154,7 @@ def test_container(): + assert "Config" in c.inspect() + assert c.get_id() == str(c) + assert repr(c) +- assert isinstance(c.get_id(), string_types) ++ assert isinstance(c.get_id(), str) + finally: + c.delete(force=True) + +@@ -618,6 +617,6 @@ def test_run_via_api(): + assert "Config" in c.inspect() + assert c.get_id() == str(c) + assert repr(c) +- assert isinstance(c.get_id(), string_types) ++ assert isinstance(c.get_id(), str) + finally: + c.delete(force=True) +Index: conu-1.0.0/tests/integration/test_filesystem.py +=================================================================== +--- conu-1.0.0.orig/tests/integration/test_filesystem.py ++++ conu-1.0.0/tests/integration/test_filesystem.py +@@ -6,7 +6,6 @@ + import os + + import pytest +-import six + + from conu.backend.docker.backend import DockerBackend + from conu.backend.docker.container import ConuException +@@ -53,12 +52,8 @@ def test_container_copy_from(docker_cont + assert fd.read() == FEDORA_RELEASE + + tmpdir.mkdir("etc") +- if six.PY2: +- with pytest.raises(OSError): +- fs.copy_from("/etc", str(tmpdir)) +- else: +- with pytest.raises(FileExistsError): +- fs.copy_from("/etc", str(tmpdir)) ++ with pytest.raises(FileExistsError): ++ fs.copy_from("/etc", str(tmpdir)) + + + def test_container_get_file(docker_container): +@@ -119,12 +114,8 @@ def test_image_copy_from(docker_image, t + assert fd.read() == FEDORA_RELEASE + + tmpdir.mkdir("etc") +- if six.PY2: +- with pytest.raises(OSError): +- fs.copy_from("/etc", str(tmpdir)) +- else: +- with pytest.raises(FileExistsError): +- fs.copy_from("/etc", str(tmpdir)) ++ with pytest.raises(FileExistsError): ++ fs.copy_from("/etc", str(tmpdir)) + + + def test_image_get_file(docker_image): +Index: conu-1.0.0/tests/integration/test_podman.py +=================================================================== +--- conu-1.0.0.orig/tests/integration/test_podman.py ++++ conu-1.0.0/tests/integration/test_podman.py +@@ -15,8 +15,6 @@ from conu.apidefs.metadata import Contai + from conu.exceptions import ConuException + from conu import Directory + +-from six import string_types +- + import pytest + + +@@ -55,7 +53,7 @@ def test_podman_image(podman_backend): + assert "registry.fedoraproject.org/fedora-minimal:33" == str(image) + assert "PodmanImage(repository=%s, tag=%s)" % (FEDORA_MINIMAL_REPOSITORY, + FEDORA_MINIMAL_REPOSITORY_TAG) == repr(image) +- assert isinstance(image.get_id(), string_types) ++ assert isinstance(image.get_id(), str) + new_image = image.tag_image(tag="test") + assert new_image.is_present() + new_image.rmi(via_name=True) +@@ -82,7 +80,7 @@ def test_container(podman_backend, podma + assert "Config" in c.inspect() + assert c.get_id() == str(c) + assert repr(c) +- assert isinstance(c.get_id(), string_types) ++ assert isinstance(c.get_id(), str) + finally: + c.delete(force=True) + diff --git a/packages/p/python-conu/python-conu.changes b/packages/p/python-conu/python-conu.changes index 205ce4ce112..cd4e50bbbe5 100644 --- a/packages/p/python-conu/python-conu.changes +++ b/packages/p/python-conu/python-conu.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Mar 20 10:16:36 UTC 2023 - pgajdos@suse.com + +- do not require six +- added patches + fix https://github.com/user-cont/conu/issues/390 + + python-conu-no-six.patch + ------------------------------------------------------------------- Wed Feb 10 04:31:04 UTC 2021 - Steve Kowalik diff --git a/packages/p/python-conu/python-conu.spec b/packages/p/python-conu/python-conu.spec index 3d0cf42e036..4afca1dab1e 100644 --- a/packages/p/python-conu/python-conu.spec +++ b/packages/p/python-conu/python-conu.spec @@ -1,7 +1,7 @@ # # spec file for package python-conu # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-conu Version: 1.0.0 @@ -25,6 +24,8 @@ Summary: Python container testing library License: MIT URL: https://github.com/user-cont/conu Source: https://files.pythonhosted.org/packages/source/c/conu/conu-%{version}.tar.gz +# https://github.com/user-cont/conu/issues/390 +Patch0: python-conu-no-six.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -33,7 +34,6 @@ Requires: python-flexmock Requires: python-kubernetes >= 8 Requires: python-pytest Requires: python-requests -Requires: python-six Recommends: docker Recommends: podman BuildArch: noarch @@ -43,7 +43,6 @@ BuildRequires: %{python_module flexmock} BuildRequires: %{python_module kubernetes >= 8} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} -BuildRequires: %{python_module six} BuildRequires: acl BuildRequires: docker BuildRequires: podman @@ -55,7 +54,7 @@ BuildRequires: user(nobody) Python container testing library. %prep -%setup -q -n conu-%{version} +%autosetup -p1 -n conu-%{version} rm tests/integration/test_k8s.py tests/integration/test_openshift.py tests/release/test_release.py %build @@ -71,6 +70,7 @@ rm tests/integration/test_k8s.py tests/integration/test_openshift.py tests/relea %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/conu +%{python_sitelib}/conu-%{version}*-info %changelog