Bug#1079869: spice-gtk: please remove dependency on python3-six using provided patch

Alexandre Detiste alexandre.detiste at gmail.com
Wed Aug 28 12:17:13 BST 2024


Source: spice-gtk
Version: 0.42-2.1
Severity: normal

Hi,

The patch is not complete: I don't know how to butcher subprojects/spice-common/m4/spice-deps.m4.

Please forward this patch upstream.

Greetings
-------------- next part --------------
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 71c7bab2..f85e04d1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,7 @@
 image: fedora:latest
 
 variables:
-  DEPS_COMMON: git make python3 python3-six redhat-rpm-config
+  DEPS_COMMON: git make python3 redhat-rpm-config
                python3-pyparsing meson ninja-build gtk-doc glib2-devel
                gettext gettext-devel gcc
 
diff --git a/debian/control b/debian/control
index 48c95c7b..eeca24ac 100644
--- a/debian/control
+++ b/debian/control
@@ -41,7 +41,6 @@ Build-Depends: debhelper-compat (= 13),
                meson (>= 0.56),
                pkg-config,
                python3-pyparsing,
-               python3-six,
                python3:any,
                valac (>= 0.18)
 Standards-Version: 4.6.2
diff --git a/debian/control.in b/debian/control.in
index 42e743c4..3643d001 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -37,7 +37,6 @@ Build-Depends: debhelper-compat (= 13),
                meson (>= 0.56),
                pkg-config,
                python3-pyparsing,
-               python3-six,
                python3:any,
                valac (>= 0.18)
 Standards-Version: 4.6.2
diff --git a/subprojects/spice-common/.gitlab-ci.yml b/subprojects/spice-common/.gitlab-ci.yml
index cfa6e720..387e9b5f 100644
--- a/subprojects/spice-common/.gitlab-ci.yml
+++ b/subprojects/spice-common/.gitlab-ci.yml
@@ -3,7 +3,7 @@ image: fedora:latest
 before_script:
   - >
     dnf install git libtool make libasan
-    python3 python3-six python3-pyparsing glib-networking
+    python3 python3-pyparsing glib-networking
     meson ninja-build gdk-pixbuf2-devel
     glib2-devel pixman-devel openssl-devel libjpeg-devel
     libcacard-devel cyrus-sasl-devel lz4-devel opus-devel
diff --git a/subprojects/spice-common/python_modules/codegen.py b/subprojects/spice-common/python_modules/codegen.py
index bfb2351b..affe5bc5 100644
--- a/subprojects/spice-common/python_modules/codegen.py
+++ b/subprojects/spice-common/python_modules/codegen.py
@@ -1,5 +1,4 @@
 
-import six
 from io import StringIO
 
 def camel_to_underscores(s, upper = False):
@@ -123,10 +122,7 @@ class CodeWriter:
 
     def write(self, s):
         # Ensure its a unicode string
-        if six.PY3:
-            s = str(s)
-        else:
-            s = unicode(s)
+        s = str(s)
 
         if len(s) == 0:
             return
diff --git a/subprojects/spice-common/python_modules/spice_parser.py b/subprojects/spice-common/python_modules/spice_parser.py
index 4d753cba..1dc7e224 100644
--- a/subprojects/spice-common/python_modules/spice_parser.py
+++ b/subprojects/spice-common/python_modules/spice_parser.py
@@ -1,11 +1,9 @@
-import six
-
 try:
     from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, ZeroOrMore, \
             Forward, delimitedList, Group, Optional, Combine, alphas, nums, restOfLine, cStyleComment, \
             alphanums, ParseException, ParseResults, Keyword, StringEnd, replaceWith
 except ImportError:
-    six.print_("Module pyparsing not found.")
+    print("Module pyparsing not found.")
     exit(1)
 
 
@@ -149,9 +147,9 @@ def parse(filename):
         bnf = SPICE_BNF()
         types = bnf.parseFile(filename)
     except ParseException as err:
-        six.print_(err.line, file=sys.stderr)
-        six.print_(" "*(err.column-1) + "^", file=sys.stderr)
-        six.print_(err, file=sys.stderr)
+        print(err.line, file=sys.stderr)
+        print(" "*(err.column-1) + "^", file=sys.stderr)
+        print(err, file=sys.stderr)
         return None
 
     for t in types:
diff --git a/subprojects/spice-common/spice_codegen.py b/subprojects/spice-common/spice_codegen.py
index d3a1bf59..03fbdd7f 100755
--- a/subprojects/spice-common/spice_codegen.py
+++ b/subprojects/spice-common/spice_codegen.py
@@ -9,7 +9,6 @@ from python_modules import ptypes
 from python_modules import codegen
 from python_modules import demarshal
 from python_modules import marshal
-import six
 
 def write_channel_enums(writer, channel, client, describe):
     messages = list(filter(lambda m : m.channel == channel, \
@@ -113,20 +112,17 @@ def write_content(dest_file, content, keep_identical_file):
             f.close()
 
             if content == old_content:
-                six.print_("No changes to %s" % dest_file)
+                print("No changes to %s" % dest_file)
                 return
 
         except IOError:
             pass
 
     f = open(dest_file, 'wb')
-    if six.PY3:
-        f.write(bytes(content, 'UTF-8'))
-    else:
-        f.write(content)
+    f.write(bytes(content, 'UTF-8'))
     f.close()
 
-    six.print_("Wrote %s" % dest_file)
+    print("Wrote %s" % dest_file)
 
 
 parser = OptionParser(usage="usage: %prog [options] <protocol_file> <destination file>")


More information about the pkg-gnome-maintainers mailing list