Hello community,

here is the log from the commit of package python-python-snappy for 
openSUSE:Factory checked in at 2019-04-17 10:07:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-snappy (Old)
 and      /work/SRC/openSUSE:Factory/.python-python-snappy.new.17052 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-python-snappy"

Wed Apr 17 10:07:20 2019 rev:2 rq:693213 version:0.5.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-python-snappy/python-python-snappy.changes    
    2019-02-01 11:45:58.888519452 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-python-snappy.new.17052/python-python-snappy.changes
     2019-04-17 10:07:25.282714402 +0200
@@ -1,0 +2,6 @@
+Thu Apr 11 11:15:21 UTC 2019 - [email protected]
+
+- version update to 0.5.4
+  * no upstream changelog
+
+-------------------------------------------------------------------

Old:
----
  python-snappy-0.5.3.tar.gz

New:
----
  python-snappy-0.5.4.tar.gz

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

Other differences:
------------------
++++++ python-python-snappy.spec ++++++
--- /var/tmp/diff_new_pack.tB231F/_old  2019-04-17 10:07:26.190715450 +0200
+++ /var/tmp/diff_new_pack.tB231F/_new  2019-04-17 10:07:26.190715450 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-python-snappy
-Version:        0.5.3
+Version:        0.5.4
 Release:        0
 Summary:        Python library for the snappy compression library
 License:        BSD-3-Clause
@@ -29,8 +29,11 @@
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  c++_compiler
 BuildRequires:  fdupes
-BuildRequires:  pkgconfig(snappy)
 BuildRequires:  python-rpm-macros
+BuildRequires:  pkgconfig(snappy)
+# SECTION test requirements
+BuildRequires:  %{python_module nose}
+# /SECTION
 %python_subpackages
 
 %description
@@ -55,6 +58,7 @@
 %{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
 $python -B test_snappy.py
 $python -B test_formats.py
+$python -B test_hadoop_snappy.py
 }
 popd
 

++++++ python-snappy-0.5.3.tar.gz -> python-snappy-0.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/PKG-INFO 
new/python-snappy-0.5.4/PKG-INFO
--- old/python-snappy-0.5.3/PKG-INFO    2018-07-04 00:14:20.000000000 +0200
+++ new/python-snappy-0.5.4/PKG-INFO    2019-03-21 14:22:29.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: python-snappy
-Version: 0.5.3
+Version: 0.5.4
 Summary: Python library for the snappy compression library from Google
 Home-page: http://github.com/andrix/python-snappy
 Author: Andres Moreira
@@ -9,7 +9,7 @@
 Description: 
         Python bindings for the snappy compression library from Google.
         
-        More details about Snappy library: http://code.google.com/p/snappy
+        More details about Snappy library: http://google.github.io/snappy
         
 Keywords: snappy,compression,google
 Platform: UNKNOWN
@@ -27,3 +27,4 @@
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/README.rst 
new/python-snappy-0.5.4/README.rst
--- old/python-snappy-0.5.3/README.rst  2018-07-04 00:10:39.000000000 +0200
+++ new/python-snappy-0.5.4/README.rst  2019-03-21 13:59:09.000000000 +0100
@@ -13,9 +13,9 @@
 
   You can install Snappy C library with following commands:
 
-  - APT: :code:`sudo apt-get install libsnappy-dev`
-  - RPM: :code:`sudo yum install libsnappy-devel`
-  - Brew:  :code:`brew install snappy`
+  - APT:  :code:`sudo apt-get install libsnappy-dev`
+  - RPM:  :code:`sudo yum install libsnappy-devel`
+  - Brew: :code:`brew install snappy`
 
 To use with pypy:
 
@@ -118,7 +118,7 @@
 
 
 Snappy - compression library from Google (c)
- http://code.google.com/p/snappy
+ http://google.github.io/snappy
  
 Frequently Asked Questions
 ==========================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/python_snappy.egg-info/PKG-INFO 
new/python-snappy-0.5.4/python_snappy.egg-info/PKG-INFO
--- old/python-snappy-0.5.3/python_snappy.egg-info/PKG-INFO     2018-07-04 
00:14:20.000000000 +0200
+++ new/python-snappy-0.5.4/python_snappy.egg-info/PKG-INFO     2019-03-21 
14:22:29.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: python-snappy
-Version: 0.5.3
+Version: 0.5.4
 Summary: Python library for the snappy compression library from Google
 Home-page: http://github.com/andrix/python-snappy
 Author: Andres Moreira
@@ -9,7 +9,7 @@
 Description: 
         Python bindings for the snappy compression library from Google.
         
-        More details about Snappy library: http://code.google.com/p/snappy
+        More details about Snappy library: http://google.github.io/snappy
         
 Keywords: snappy,compression,google
 Platform: UNKNOWN
@@ -27,3 +27,4 @@
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/python_snappy.egg-info/pbr.json 
new/python-snappy-0.5.4/python_snappy.egg-info/pbr.json
--- old/python-snappy-0.5.3/python_snappy.egg-info/pbr.json     2018-07-04 
00:14:20.000000000 +0200
+++ new/python-snappy-0.5.4/python_snappy.egg-info/pbr.json     2019-03-21 
14:22:29.000000000 +0100
@@ -1 +1 @@
-{"git_version": "6bedadb", "is_release": false}
\ No newline at end of file
+{"git_version": "d9ad46b", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/setup.py 
new/python-snappy-0.5.4/setup.py
--- old/python-snappy-0.5.3/setup.py    2018-07-04 00:14:10.000000000 +0200
+++ new/python-snappy-0.5.4/setup.py    2019-03-21 14:15:50.000000000 +0100
@@ -29,11 +29,11 @@
 except ImportError:
     from distutils.core import setup, Extension
 
-version = '0.5.3'
+version = '0.5.4'
 long_description = """
 Python bindings for the snappy compression library from Google.
 
-More details about Snappy library: http://code.google.com/p/snappy
+More details about Snappy library: http://google.github.io/snappy
 """
 
 
@@ -79,6 +79,7 @@
                  'Programming Language :: Python :: 3',
                  'Programming Language :: Python :: 3.5',
                  'Programming Language :: Python :: 3.6',
+                 'Programming Language :: Python :: 3.7',
                  ],
     ext_modules=ext_modules,
     packages=packages,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/snappy/snappy.py 
new/python-snappy-0.5.4/snappy/snappy.py
--- old/python-snappy-0.5.3/snappy/snappy.py    2018-07-04 00:10:39.000000000 
+0200
+++ new/python-snappy-0.5.4/snappy/snappy.py    2019-03-21 13:59:09.000000000 
+0100
@@ -127,13 +127,12 @@
         snappy's performance. If compress == True, compression always happens,
         and if compress == False, compression never happens.
         """
+        out = bytearray()
         if not self._header_chunk_written:
             self._header_chunk_written = True
-            out = [struct.pack("<L", _IDENTIFIER_CHUNK +
-                                      (len(_STREAM_IDENTIFIER) << 8)),
-                   _STREAM_IDENTIFIER]
-        else:
-            out = []
+            out.extend(struct.pack("<L", _IDENTIFIER_CHUNK +
+                                      (len(_STREAM_IDENTIFIER) << 8)))
+            out.extend(_STREAM_IDENTIFIER)
         for i in range(0, len(data), _CHUNK_MAX):
             chunk = data[i:i + _CHUNK_MAX]
             crc = _masked_crc32c(chunk)
@@ -151,10 +150,10 @@
                 chunk_type = _COMPRESSED_CHUNK
             else:
                 chunk_type = _UNCOMPRESSED_CHUNK
-            out.append(struct.pack("<LL", chunk_type + ((len(chunk) + 4) << 8),
+            out.extend(struct.pack("<LL", chunk_type + ((len(chunk) + 4) << 8),
                                    crc))
-            out.append(chunk)
-        return b"".join(out)
+            out.extend(chunk)
+        return bytes(out)
 
     def compress(self, data):
         """This method is simply an alias for compatibility with zlib
@@ -193,7 +192,7 @@
     __slots__ = ["_buf", "_header_found"]
 
     def __init__(self):
-        self._buf = b""
+        self._buf = bytearray()
         self._header_found = False
 
     @staticmethod
@@ -222,11 +221,11 @@
         the decompress() method. Some of the input data may be preserved in
         internal buffers for later processing.
         """
-        self._buf += data
-        uncompressed = []
+        self._buf.extend(data)
+        uncompressed = bytearray()
         while True:
             if len(self._buf) < 4:
-                return b"".join(uncompressed)
+                return bytes(uncompressed)
             chunk_type = struct.unpack("<L", self._buf[:4])[0]
             size = (chunk_type >> 8)
             chunk_type &= 0xff
@@ -240,7 +239,7 @@
                 raise UncompressError(
                     "stream received unskippable but unknown chunk")
             if len(self._buf) < 4 + size:
-                return b"".join(uncompressed)
+                return bytes(uncompressed)
             chunk, self._buf = self._buf[4:4 + size], self._buf[4 + size:]
             if chunk_type == _IDENTIFIER_CHUNK:
                 if chunk != _STREAM_IDENTIFIER:
@@ -256,7 +255,7 @@
                 chunk = _uncompress(chunk)
             if struct.pack("<L", _masked_crc32c(chunk)) != crc:
                 raise UncompressError("crc mismatch")
-            uncompressed.append(chunk)
+            uncompressed += chunk
 
     def flush(self):
         """All pending input is processed, and a string containing the
@@ -274,7 +273,7 @@
         to speed up random seeks into the stream at a future point.
         """
         copy = StreamDecompressor()
-        copy._buf, copy._header_found = self._buf, self._header_found
+        copy._buf, copy._header_found = bytearray(self._buf), 
self._header_found
         return copy
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/snappy/snappy_cffi.py 
new/python-snappy-0.5.4/snappy/snappy_cffi.py
--- old/python-snappy-0.5.3/snappy/snappy_cffi.py       2018-07-04 
00:10:39.000000000 +0200
+++ new/python-snappy-0.5.4/snappy/snappy_cffi.py       2019-03-21 
13:59:09.000000000 +0100
@@ -20,7 +20,7 @@
     _out_data = None
     _out_size = None
 
-    _out_data = ffi.new('char[]', data)
+    _out_data = ffi.from_buffer(data)
     _out_size = ffi.cast('size_t', len(data))
 
     return (_out_data, _out_size)
@@ -89,6 +89,6 @@
 decompress = uncompress
 
 def _crc32c(data):
-    c_data = ffi.new('char[]', data)
+    c_data = ffi.from_buffer(data)
     size = ffi.cast('int', len(data))
     return int(lib._crc32c(c_data, size))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/snappy/snappymodule.cc 
new/python-snappy-0.5.4/snappy/snappymodule.cc
--- old/python-snappy-0.5.3/snappy/snappymodule.cc      2018-07-04 
00:10:39.000000000 +0200
+++ new/python-snappy-0.5.4/snappy/snappymodule.cc      2019-03-21 
13:59:09.000000000 +0100
@@ -203,18 +203,22 @@
 static PyObject *
 snappy__crc32c(PyObject *self, PyObject *args)
 {
-    const unsigned char * input;
-    int input_size;
+    Py_buffer input;
+    PyObject * result;
 
 #if PY_MAJOR_VERSION >= 3
-    if (!PyArg_ParseTuple(args, "y#", &input, &input_size))
+    if (!PyArg_ParseTuple(args, "y*", &input))
 #else
-    if (!PyArg_ParseTuple(args, "s#", &input, &input_size))
+    if (!PyArg_ParseTuple(args, "s*", &input))
 #endif
         return NULL;
 
-    return PyLong_FromUnsignedLong(
-            crc_finalize(crc_update(crc_init(), input, input_size)));
+    result = PyLong_FromUnsignedLong(
+            crc_finalize(crc_update(crc_init(), (const unsigned char *) 
input.buf, input.len)));
+
+    PyBuffer_Release(&input);
+
+    return result;
 }
 
 static PyMethodDef snappy_methods[] = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-snappy-0.5.3/test_snappy.py 
new/python-snappy-0.5.4/test_snappy.py
--- old/python-snappy-0.5.3/test_snappy.py      2018-07-04 00:10:39.000000000 
+0200
+++ new/python-snappy-0.5.4/test_snappy.py      2019-03-21 13:59:09.000000000 
+0100
@@ -163,6 +163,18 @@
                 b"\x01\x04\x00\x01" + crc1 + data[:snappy.snappy._CHUNK_MAX] +
                 b"\x01\xff\xff\x00" + crc2 + data[snappy.snappy._CHUNK_MAX:])
 
+        # test that we can compress a memoryview
+        data = memoryview(b"\x01" * (snappy.snappy._CHUNK_MAX * 2 - 5))
+        crc1 = struct.pack("<L",
+                snappy.snappy._masked_crc32c(data[:snappy.snappy._CHUNK_MAX]))
+        self.assertEqual(crc1, b"h#6\x8e")
+        crc2 = struct.pack("<L",
+                snappy.snappy._masked_crc32c(data[snappy.snappy._CHUNK_MAX:]))
+        self.assertEqual(crc2, b"q\x8foE")
+        self.assertEqual(compressor.add_chunk(data, compress=False),
+                b"\x01\x04\x00\x01" + crc1 + 
data[:snappy.snappy._CHUNK_MAX].tobytes() +
+                b"\x01\xff\xff\x00" + crc2 + 
data[snappy.snappy._CHUNK_MAX:].tobytes())
+
     def test_decompression(self):
         # test that we check for the initial stream identifier
         data = b"\x01" * 50
@@ -218,6 +230,15 @@
                      decompressor.decompress(compressed_data[split2:])),
                     uncompressed_data)
 
+        # test that we can decompress a memoryview
+        decompressor = snappy.StreamDecompressor()
+        decompressor.decompress(memoryview(b"\xff\x06\x00\x00sNaPpY"))
+        self.assertEqual(
+                decompressor.copy().decompress(
+                    memoryview(b"\x01\x36\x00\x00" +
+                    struct.pack("<L", snappy.snappy._masked_crc32c(data)) + 
data)),
+                data)
+
     def test_concatenation(self):
         data1 = os.urandom(snappy.snappy._CHUNK_MAX * 2)
         data2 = os.urandom(4096)


Reply via email to