diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d3d1e1e..b6636d0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -57,7 +57,6 @@ jobs: python3-pycurl \ python3-pygments \ python3-pyflakes \ - python3-six \ python3-wheel \ rpm-build \ tar \ diff --git a/.gitignore b/.gitignore index 38c1205..5fbeddc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ PKG-INFO setup.py version.py +lib/ovirtsdk4/__pycache__/ diff --git a/examples/asynchronous_inventory.py b/examples/asynchronous_inventory.py index 41cb4e5..31d9650 100755 --- a/examples/asynchronous_inventory.py +++ b/examples/asynchronous_inventory.py @@ -17,10 +17,10 @@ # limitations under the License. # +from itertools import zip_longest import logging import ovirtsdk4 as sdk -from six.moves import zip_longest # This example shows how to use the asynchronous and pipelining capabilities # of the SDK to download from the server large amounts of data in an efficient diff --git a/lib/ovirt_engine_sdk_python.egg-info/requires.txt b/lib/ovirt_engine_sdk_python.egg-info/requires.txt index 17b2948..5f530ab 100644 --- a/lib/ovirt_engine_sdk_python.egg-info/requires.txt +++ b/lib/ovirt_engine_sdk_python.egg-info/requires.txt @@ -1,2 +1 @@ pycurl>=7.19.0 -six diff --git a/lib/ovirtsdk4/__init__.py b/lib/ovirtsdk4/__init__.py index 2cca6d8..40fb611 100644 --- a/lib/ovirtsdk4/__init__.py +++ b/lib/ovirtsdk4/__init__.py @@ -21,7 +21,6 @@ import os import pycurl import re -import six import sys import threading @@ -764,7 +763,7 @@ def test(self, raise_exception=False): return True except Error: if raise_exception: - six.reraise(*sys.exc_info()) + raise return False except Exception as exception: if raise_exception: @@ -951,7 +950,7 @@ def __parse_error(self, error): elif e_code == pycurl.E_OPERATION_TIMEOUTED: clazz = TimeoutError - six.reraise(clazz, clazz(error_msg), sys.exc_info()[2]) + raise clazz(error_msg).with_traceback(sys.exc_info()[2]) def _get_header_value(self, headers, name): """ diff --git a/lib/ovirtsdk4/reader.py b/lib/ovirtsdk4/reader.py index 7cf327d..f4719eb 100644 --- a/lib/ovirtsdk4/reader.py +++ b/lib/ovirtsdk4/reader.py @@ -20,7 +20,6 @@ import time import io import re -import six from ovirtsdk4 import Error from ovirtsdk4 import xml @@ -304,8 +303,7 @@ def read(cls, source): # In Python 3 str is a list of 16 bits characters, so it # needs to be converted to an array of bytes, using UTF-8, # before trying to parse it. - if six.PY3: - source = source.encode('utf-8') + source = source.encode('utf-8') cursor = xml.XmlReader(io.BytesIO(source)) elif isinstance(source, bytes): cursor = xml.XmlReader(io.BytesIO(source)) diff --git a/lib/ovirtsdk4/service.py b/lib/ovirtsdk4/service.py index da781f4..6474724 100644 --- a/lib/ovirtsdk4/service.py +++ b/lib/ovirtsdk4/service.py @@ -16,8 +16,6 @@ # limitations under the License. # -import six - from ovirtsdk4 import AuthError from ovirtsdk4 import Error from ovirtsdk4 import NotFoundError @@ -103,7 +101,7 @@ def _raise_error(response, detail=None): msg += ' ' msg = msg + 'HTTP response message is "%s".' % response.message - if isinstance(detail, six.string_types): + if isinstance(detail, str): if msg: msg += ' ' msg = msg + detail + '.' diff --git a/python-ovirt-engine-sdk4.spec.in b/python-ovirt-engine-sdk4.spec.in index 1fc443d..d04c9cb 100644 --- a/python-ovirt-engine-sdk4.spec.in +++ b/python-ovirt-engine-sdk4.spec.in @@ -21,7 +21,6 @@ BuildRequires: python3-devel Requires: libxml2 Requires: python3 Requires: python3-pycurl >= 7.43.0-6 -Requires: python3-six %description -n python3-ovirt-engine-sdk4 This package contains the Python 3 SDK for version 4 of the oVirt Engine @@ -34,7 +33,6 @@ BuildRequires: python3.11-setuptools Requires: libxml2 Requires: python3.11 Requires: python3.11-pycurl >= 7.43.0-6 -Requires: python3.11-six %description -n python3.11-ovirt-engine-sdk4 This package contains the Python 3.11 SDK for version 4 of the oVirt Engine @@ -47,7 +45,6 @@ BuildRequires: python3.12-setuptools Requires: libxml2 Requires: python3.12 Requires: python3.12-pycurl >= 7.43.0-6 -Requires: python3.12-six %description -n python3.12-ovirt-engine-sdk4 This package contains the Python 3.12 SDK for version 4 of the oVirt Engine diff --git a/setup.py.in b/setup.py.in index 3758f1c..e7187b0 100644 --- a/setup.py.in +++ b/setup.py.in @@ -27,7 +27,6 @@ import sys # Required packages: requires = [ 'pycurl >= 7.19.0', - 'six', ] # Python before version 3.4 doesn't support enum types, which we need, diff --git a/tests/test_vm_reader.py b/tests/test_vm_reader.py index 694c859..7b766e8 100644 --- a/tests/test_vm_reader.py +++ b/tests/test_vm_reader.py @@ -16,8 +16,6 @@ # limitations under the License. # -import six - import ovirtsdk4.types as types from io import BytesIO @@ -33,8 +31,7 @@ def make_buffer(text): """ Creates an IO object to be used for writing. """ - if six.PY3: - text = text.encode('utf-8') + text = text.encode('utf-8') return BytesIO(text) diff --git a/tests/test_xml_reader.py b/tests/test_xml_reader.py index 34f513d..a647032 100644 --- a/tests/test_xml_reader.py +++ b/tests/test_xml_reader.py @@ -16,8 +16,6 @@ # limitations under the License. # -import six - from io import BytesIO from nose.tools import * from ovirtsdk4.xml import XmlReader @@ -27,8 +25,7 @@ def make_reader(text): """ Creates an IO objec that reads from the given text. """ - if six.PY3: - text = text.encode('utf-8') + text = text.encode('utf-8') return XmlReader(BytesIO(text))