[pygobject] gitlab-ci: Install pep8 package, "make check.quality" requires it



commit 162b6ab75d3c3d1717245f5957433b8cf400b17a
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Jan 19 20:08:31 2018 +0100

    gitlab-ci: Install pep8 package, "make check.quality" requires it
    
    While pep8 is replaced by pycodestyle, the "make check.quality"
    command still uses pep8. Install it for now and fix some warnings
    which slipped through due to pep8 not running.

 .gitlab-ci/test-docker.sh    | 2 +-
 gi/overrides/GLib.py         | 5 +++--
 tests/test_overrides_glib.py | 1 -
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 4143face..6473541c 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -6,7 +6,7 @@ virtualenv --python="${PYTHON}" /tmp/venv
 source /tmp/venv/bin/activate
 
 python -m pip install git+https://github.com/pygobject/pycairo.git
-python -m pip install pyflakes pycodestyle
+python -m pip install pyflakes pycodestyle pep8
 
 export PKG_CONFIG_PATH=/tmp/venv/share/pkgconfig
 export MALLOC_CHECK_=3
diff --git a/gi/overrides/GLib.py b/gi/overrides/GLib.py
index 339d74a1..f47a338e 100644
--- a/gi/overrides/GLib.py
+++ b/gi/overrides/GLib.py
@@ -128,7 +128,7 @@ class _VariantCreator(object):
 
         if not isinstance(value, (dict, tuple, list)):
             raise TypeError("Could not create array, tuple or dictionary entry from non iterable value %s 
%s" %
-                    (format, value))
+                            (format, value))
 
         if gvtype.is_tuple() and gvtype.n_items() != len(value):
             raise TypeError("Tuple mismatches value's number of elements %s %s" % (format, value))
@@ -150,6 +150,7 @@ class _VariantCreator(object):
 
         return builder.end()
 
+
 class Variant(GLib.Variant):
     def __new__(cls, format_string, value):
         """Create a GVariant from a native Python object.
@@ -163,7 +164,7 @@ class Variant(GLib.Variant):
           GLib.Variant('(asa{sv})', ([], {'foo': GLib.Variant('b', True),
                                           'bar': GLib.Variant('i', 2)}))
         """
-        if not GLib.VariantType.string_is_valid (format_string):
+        if not GLib.VariantType.string_is_valid(format_string):
             raise TypeError("Invalid GVariant format string '%s'", format_string)
         creator = _VariantCreator()
         v = creator._create(format_string, value)
diff --git a/tests/test_overrides_glib.py b/tests/test_overrides_glib.py
index a7b3f1fa..a9d5b58b 100644
--- a/tests/test_overrides_glib.py
+++ b/tests/test_overrides_glib.py
@@ -168,7 +168,6 @@ class TestGVariant(unittest.TestCase):
         element = array.get_child_value(2)
         self.assertEqual(element.n_children(), 0)
 
-
     def test_create_complex(self):
         variant = GLib.Variant('(as)', ([],))
         self.assertEqual(variant.get_type_string(), '(as)')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]