Hello community,

here is the log from the commit of package python-xcffib for openSUSE:Factory 
checked in at 2020-10-29 09:22:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xcffib (Old)
 and      /work/SRC/openSUSE:Factory/.python-xcffib.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-xcffib"

Thu Oct 29 09:22:12 2020 rev:9 rq:844109 version:0.10.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xcffib/python-xcffib.changes      
2020-02-25 16:04:09.572318361 +0100
+++ /work/SRC/openSUSE:Factory/.python-xcffib.new.3463/python-xcffib.changes    
2020-10-29 09:22:16.462685920 +0100
@@ -1,0 +2,11 @@
+Mon Oct 26 13:01:07 UTC 2020 - John Vandenberg <[email protected]>
+
+- Re-activate tests
+- Update to 0.10.1
+  * testing: handle lock file open() failures gracefully 
+- from v0.10.0
+  * Drop support for Python 2.7
+  * testing: protect find_display() with flock()
+  * testing: don't leak discard FD
+
+-------------------------------------------------------------------

Old:
----
  xcffib-0.9.0.tar.gz

New:
----
  xcffib-0.10.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-xcffib.spec ++++++
--- /var/tmp/diff_new_pack.HsHnpR/_old  2020-10-29 09:22:17.094686526 +0100
+++ /var/tmp/diff_new_pack.HsHnpR/_new  2020-10-29 09:22:17.094686526 +0100
@@ -17,8 +17,9 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
 Name:           python-xcffib
-Version:        0.9.0
+Version:        0.10.1
 Release:        0
 Summary:        A drop in replacement for xpyb, an XCB python binding
 License:        Apache-2.0
@@ -45,8 +46,6 @@
 
 %prep
 %setup -q -n xcffib-%{version}
-# upstream moves files compared to git repository
-sed -i -e 's:from \.testing:from testing:g' test/*.py
 
 %build
 %python_build
@@ -56,9 +55,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-# Skip the tests as they deadlock here and there in xvfb
-# self.conn.wait_for_event() waits without end
-#%%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} xvfb-run 
nosetests-%{$python_bin_suffix} -v
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} xvfb-run 
nosetests-%{$python_bin_suffix} -v
 
 %files %{python_files}
 %license LICENSE

++++++ xcffib-0.9.0.tar.gz -> xcffib-0.10.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/MANIFEST.in 
new/xcffib-0.10.1/MANIFEST.in
--- old/xcffib-0.9.0/MANIFEST.in        2018-10-11 23:32:44.000000000 +0200
+++ new/xcffib-0.10.1/MANIFEST.in       2020-07-21 14:59:17.000000000 +0200
@@ -1,3 +1,4 @@
 include README.md
 include LICENSE
 exclude xcffib/_ffi.py
+include test/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/PKG-INFO new/xcffib-0.10.1/PKG-INFO
--- old/xcffib-0.9.0/PKG-INFO   2019-12-26 22:05:49.000000000 +0100
+++ new/xcffib-0.10.1/PKG-INFO  2020-07-22 04:06:39.721261300 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: xcffib
-Version: 0.9.0
+Version: 0.10.1
 Summary: A drop in replacement for xpyb, an XCB python binding
 Home-page: http://github.com/tych0/xcffib
 Author: Tycho Andersen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/README.md new/xcffib-0.10.1/README.md
--- old/xcffib-0.9.0/README.md  2019-06-04 04:47:34.000000000 +0200
+++ new/xcffib-0.10.1/README.md 2020-05-25 06:43:26.000000000 +0200
@@ -65,10 +65,9 @@
   for a `<list type="char"/>`, you can use a python string literal. `xcffib`
   also gives you a string of length 1 out for each element in such a list,
   instead of an `int`. Finally, there is a helper method called `to_string` on
-  `xcffib.List`, to convert these string-like things into native strings. In
-  both python2 and python3 you get a native `str`. This means that for things
-  like `xproto.STR`, you can just do `the_str.name.to_string()` instead of
-  `''.join(map(chr, the_str.name))`.
+  `xcffib.List`, to convert these string-like things into native strings. This
+  means that for things like `xproto.STR`, you can just do
+  `the_str.name.to_string()` instead of `''.join(map(chr, the_str.name))`.
 * As above, `void` is also packed/unpacked as `char`s, since the convention is
   to use it as string data, e.g. in `xproto.ChangeProperty`.
 * The submodule `xcb` is gone. The top module re-exported all these constants
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/setup.py new/xcffib-0.10.1/setup.py
--- old/xcffib-0.9.0/setup.py   2019-12-26 22:05:48.000000000 +0100
+++ new/xcffib-0.10.1/setup.py  2020-07-22 04:06:39.000000000 +0200
@@ -60,7 +60,7 @@
         cffi_modules=["xcffib/ffi_build.py:ffi"]
     )
 
-version = "0.9.0"
+version = "0.10.1"
 dependencies = ['six', requires_cffi]
 
 setup(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/xcffib/__init__.py 
new/xcffib-0.10.1/xcffib/__init__.py
--- old/xcffib-0.9.0/xcffib/__init__.py 2019-12-26 22:05:48.000000000 +0100
+++ new/xcffib-0.10.1/xcffib/__init__.py        2020-07-22 04:06:39.000000000 
+0200
@@ -37,8 +37,8 @@
         soname = "libxcb.so"
 lib = ffi.dlopen(soname)
 
-__xcb_proto_version__ = "1.13"
-__version__ = "0.9.0"
+__xcb_proto_version__ = "1.14"
+__version__ = "0.10.1"
 
 X_PROTOCOL = lib.X_PROTOCOL
 X_PROTOCOL_REVISION = lib.X_PROTOCOL_REVISION
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/xcffib/screensaver.py 
new/xcffib-0.10.1/xcffib/screensaver.py
--- old/xcffib-0.9.0/xcffib/screensaver.py      2019-12-26 22:05:48.000000000 
+0100
+++ new/xcffib-0.10.1/xcffib/screensaver.py     2020-07-22 04:06:38.000000000 
+0200
@@ -134,6 +134,6 @@
         return self.send_request(4, buf, is_checked=is_checked)
     def Suspend(self, suspend, is_checked=False):
         buf = six.BytesIO()
-        buf.write(struct.pack("=xx2xB3x", suspend))
+        buf.write(struct.pack("=xx2xI", suspend))
         return self.send_request(5, buf, is_checked=is_checked)
 xcffib._add_ext(key, screensaverExtension, _events, _errors)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/xcffib/testing.py 
new/xcffib-0.10.1/xcffib/testing.py
--- old/xcffib-0.9.0/xcffib/testing.py  2019-12-26 22:05:48.000000000 +0100
+++ new/xcffib-0.10.1/xcffib/testing.py 2020-07-22 04:06:39.000000000 +0200
@@ -15,6 +15,7 @@
 # Not strictly necessary to be included with the binding, but may be useful for
 # others who want to test things using xcffib.
 
+import fcntl
 import os
 import time
 import errno
@@ -30,9 +31,17 @@
 def find_display():
     display = 10
     while True:
-        if not os.path.exists(lock_path(display)):
-            return display
-        display += 1
+        try:
+            f = open(lock_path(display), "w+")
+            try:
+                fcntl.flock(f.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
+            except OSError:
+                f.close()
+                raise
+        except OSError:
+            display += 1
+            continue
+        return display, f
 
 
 class XvfbTest(object):
@@ -52,17 +61,18 @@
 
     def spawn(self, cmd):
         """ Spawn a command but swallow its output. """
-        discard = open(os.devnull)
-        return subprocess.Popen(cmd, stdout=discard, stderr=discard)
+        return subprocess.Popen(cmd, stdout=subprocess.DEVNULL, 
stderr=subprocess.DEVNULL)
 
     def setUp(self):
         self._old_display = os.environ.get('DISPLAY')
-        os.environ['DISPLAY'] = ':%d' % self._find_display()
+        self._display, self._display_lock = find_display()
+        os.environ['DISPLAY'] = ':%d' % self._display
         self._xvfb = self.spawn(self._xvfb_command())
 
         if self.xtrace:
             subprocess.Popen(['xtrace', '-n'])
-            # xtrace's default display is :9
+            # xtrace's default display is :9; obviously this won't work
+            # concurrently, but it's not the default so...
             os.environ['DISPLAY'] = ':9'
         self.conn = self._connect_to_xvfb()
 
@@ -83,6 +93,7 @@
         # Delete our X lock file too, since we .kill() the process so it won't
         # clean up after itself.
         try:
+            self._display_lock.close()
             os.remove(lock_path(self._display))
         except OSError as e:
             # we don't care if it doesn't exist, maybe something crashed and
@@ -119,10 +130,3 @@
             except ConnectionException:
                 time.sleep(0.2)
         assert False, "couldn't connect to xvfb"
-
-    def _find_display(self):
-        # Don't do this for every test.
-        if hasattr(self, '_display'):
-            return self._display
-        self._display = find_display()
-        return self._display
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/xcffib.egg-info/PKG-INFO 
new/xcffib-0.10.1/xcffib.egg-info/PKG-INFO
--- old/xcffib-0.9.0/xcffib.egg-info/PKG-INFO   2019-12-26 22:05:49.000000000 
+0100
+++ new/xcffib-0.10.1/xcffib.egg-info/PKG-INFO  2020-07-22 04:06:39.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: xcffib
-Version: 0.9.0
+Version: 0.10.1
 Summary: A drop in replacement for xpyb, an XCB python binding
 Home-page: http://github.com/tych0/xcffib
 Author: Tycho Andersen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcffib-0.9.0/xcffib.egg-info/SOURCES.txt 
new/xcffib-0.10.1/xcffib.egg-info/SOURCES.txt
--- old/xcffib-0.9.0/xcffib.egg-info/SOURCES.txt        2019-12-26 
22:05:49.000000000 +0100
+++ new/xcffib-0.10.1/xcffib.egg-info/SOURCES.txt       2020-07-22 
04:06:39.000000000 +0200
@@ -2,6 +2,7 @@
 MANIFEST.in
 README.md
 setup.py
+test/__init__.py
 test/test_connection.py
 test/test_crazy_window_script.py
 test/test_fakeinput.py


Reply via email to