Hello community,

here is the log from the commit of package python-libarchive-c for 
openSUSE:Leap:15.2 checked in at 2020-04-30 18:51:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-libarchive-c (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-libarchive-c.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-libarchive-c"

Thu Apr 30 18:51:40 2020 rev:12 rq:794504 version:2.9

Changes:
--------
--- 
/work/SRC/openSUSE:Leap:15.2/python-libarchive-c/python-libarchive-c.changes    
    2020-03-09 18:07:40.152886132 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.python-libarchive-c.new.2738/python-libarchive-c.changes
      2020-04-30 18:51:41.448630156 +0200
@@ -1,0 +2,15 @@
+Wed Apr 15 12:28:28 UTC 2020 - [email protected]
+
+- version update to 2.9
+  * Changes to the library:
+      optimized the ArchiveEntry class (#94)
+      added support for the zstd format (#90)
+      fixed the top-level __all__ list (7b97d8b)
+      updated the code to support Python 3.8 (#88)
+      improved the add_file_from_memory method (#85 and #86)
+      lowered the level of log messages from warning to info (#83)
+  * Tests:
+      dropped testing with Python 3.4, added 3.7 and 3.8 (#88)
+      fixed unicode handling in entry tests (#84)
+
+-------------------------------------------------------------------

Old:
----
  libarchive-c-2.8.tar.gz

New:
----
  libarchive-c-2.9.tar.gz

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

Other differences:
------------------
++++++ python-libarchive-c.spec ++++++
--- /var/tmp/diff_new_pack.dwxCj4/_old  2020-04-30 18:51:41.908631136 +0200
+++ /var/tmp/diff_new_pack.dwxCj4/_new  2020-04-30 18:51:41.912631145 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-libarchive-c
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,9 +17,8 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_without test
 Name:           python-libarchive-c
-Version:        2.8
+Version:        2.9
 Release:        0
 Summary:        Python interface to libarchive
 License:        CC0-1.0
@@ -31,11 +30,11 @@
 BuildRequires:  python-rpm-macros
 Requires:       libarchive-devel
 BuildArch:      noarch
-%if %{with test}
+# SECTION test requirements
 BuildRequires:  %{python_module mock}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  libarchive-devel
-%endif
+# /SECTION
 %python_subpackages
 
 %description
@@ -52,10 +51,9 @@
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-%if %{with test}
 %check
-%python_exec setup.py test
-%endif
+export LANG="en_US.UTF-8"
+%pytest
 
 %files %{python_files}
 %doc README.rst

++++++ libarchive-c-2.8.tar.gz -> libarchive-c-2.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/.travis.yml 
new/libarchive-c-2.9/.travis.yml
--- old/libarchive-c-2.8/.travis.yml    2018-06-10 15:01:15.000000000 +0200
+++ new/libarchive-c-2.9/.travis.yml    2019-10-20 13:18:23.000000000 +0200
@@ -2,9 +2,13 @@
 matrix:
   include:
     - python: 3.5
-      env: TOXENV=py27,py34,py35
+      env: TOXENV=py27,py35
     - python: 3.6
       env: TOXENV=py36
+    - python: 3.7
+      env: TOXENV=py37
+    - python: 3.8-dev
+      env: TOXENV=py38
 
 branches:
   only:
@@ -35,4 +39,4 @@
   email: false
 
 sudo: required
-dist: trusty
+dist: xenial
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/PKG-INFO 
new/libarchive-c-2.9/PKG-INFO
--- old/libarchive-c-2.8/PKG-INFO       2018-06-10 15:30:39.000000000 +0200
+++ new/libarchive-c-2.9/PKG-INFO       2019-10-20 14:40:31.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 2.1
 Name: libarchive-c
-Version: 2.8
+Version: 2.9
 Summary: Python interface to libarchive
 Home-page: https://github.com/Changaco/python-libarchive-c
 Author: Changaco
@@ -22,11 +22,21 @@
         Compatibility
         =============
         
+        python
+        ------
+        
         python-libarchive-c is currently tested with python 2.7, 3.4, 3.5, and 
3.6.
         
         If you find an incompatibility with older versions you can send us a 
small patch,
         but we won't accept big changes.
         
+        libarchive
+        ----------
+        
+        python-libarchive-c may not work properly with obsolete versions of 
libarchive such as the ones included in MacOS. In that case you can install a 
recent version of libarchive (e.g. with ``brew install libarchive`` on MacOS) 
and use the ``LIBARCHIVE`` environment variable to point python-libarchive-c to 
it::
+        
+            export 
LIBARCHIVE=/usr/local/Cellar/libarchive/3.3.3/lib/libarchive.13.dylib
+        
         Usage
         =====
         
@@ -68,3 +78,4 @@
         
 Keywords: archive libarchive 7z tar bz2 zip gz
 Platform: UNKNOWN
+Description-Content-Type: text/x-rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/README.rst 
new/libarchive-c-2.9/README.rst
--- old/libarchive-c-2.8/README.rst     2018-06-10 13:44:41.000000000 +0200
+++ new/libarchive-c-2.9/README.rst     2018-12-06 11:57:08.000000000 +0100
@@ -14,11 +14,21 @@
 Compatibility
 =============
 
+python
+------
+
 python-libarchive-c is currently tested with python 2.7, 3.4, 3.5, and 3.6.
 
 If you find an incompatibility with older versions you can send us a small 
patch,
 but we won't accept big changes.
 
+libarchive
+----------
+
+python-libarchive-c may not work properly with obsolete versions of libarchive 
such as the ones included in MacOS. In that case you can install a recent 
version of libarchive (e.g. with ``brew install libarchive`` on MacOS) and use 
the ``LIBARCHIVE`` environment variable to point python-libarchive-c to it::
+
+    export 
LIBARCHIVE=/usr/local/Cellar/libarchive/3.3.3/lib/libarchive.13.dylib
+
 Usage
 =====
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/libarchive/__init__.py 
new/libarchive-c-2.9/libarchive/__init__.py
--- old/libarchive-c-2.8/libarchive/__init__.py 2018-06-10 15:01:15.000000000 
+0200
+++ new/libarchive-c-2.9/libarchive/__init__.py 2019-10-20 13:18:23.000000000 
+0200
@@ -6,10 +6,10 @@
 )
 from .write import custom_writer, fd_writer, file_writer, memory_writer
 
-__all__ = [
+__all__ = [x.__name__ for x in (
     ArchiveEntry,
     ArchiveError,
     extract_fd, extract_file, extract_memory,
     custom_reader, fd_reader, file_reader, memory_reader, stream_reader,
     custom_writer, fd_writer, file_writer, memory_writer
-]
+)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/libarchive/entry.py 
new/libarchive-c-2.9/libarchive/entry.py
--- old/libarchive-c-2.8/libarchive/entry.py    2018-06-10 15:01:15.000000000 
+0200
+++ new/libarchive-c-2.9/libarchive/entry.py    2019-10-20 13:18:23.000000000 
+0200
@@ -24,6 +24,8 @@
 
 class ArchiveEntry(object):
 
+    __slots__ = ('_archive_p', '_entry_p')
+
     def __init__(self, archive_p, entry_p):
         self._archive_p = archive_p
         self._entry_p = entry_p
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/libarchive/ffi.py 
new/libarchive-c-2.9/libarchive/ffi.py
--- old/libarchive-c-2.8/libarchive/ffi.py      2018-06-10 15:27:14.000000000 
+0200
+++ new/libarchive-c-2.9/libarchive/ffi.py      2019-10-20 13:18:23.000000000 
+0200
@@ -162,18 +162,18 @@
     try:
         ffi('read_support_format_'+f_name, [c_archive_p], c_int, check_int)
     except AttributeError:  # pragma: no cover
-        logger.warning('read format "%s" is not supported' % f_name)
+        logger.info('read format "%s" is not supported' % f_name)
         READ_FORMATS.remove(f_name)
 
 READ_FILTERS = set((
     'all', 'bzip2', 'compress', 'grzip', 'gzip', 'lrzip', 'lzip', 'lzma',
-    'lzop', 'none', 'rpm', 'uu', 'xz', 'lz4'
+    'lzop', 'none', 'rpm', 'uu', 'xz', 'lz4', 'zstd'
 ))
 for f_name in list(READ_FILTERS):
     try:
         ffi('read_support_filter_'+f_name, [c_archive_p], c_int, check_int)
     except AttributeError:  # pragma: no cover
-        logger.warning('read filter "%s" is not supported' % f_name)
+        logger.info('read filter "%s" is not supported' % f_name)
         READ_FILTERS.remove(f_name)
 
 ffi('read_open',
@@ -224,18 +224,18 @@
     try:
         ffi('write_set_format_'+f_name, [c_archive_p], c_int, check_int)
     except AttributeError:  # pragma: no cover
-        logger.warning('write format "%s" is not supported' % f_name)
+        logger.info('write format "%s" is not supported' % f_name)
         WRITE_FORMATS.remove(f_name)
 
 WRITE_FILTERS = set((
     'b64encode', 'bzip2', 'compress', 'grzip', 'gzip', 'lrzip', 'lzip', 'lzma',
-    'lzop', 'uuencode', 'xz', 'lz4'
+    'lzop', 'uuencode', 'xz', 'lz4', 'zstd'
 ))
 for f_name in list(WRITE_FILTERS):
     try:
         ffi('write_add_filter_'+f_name, [c_archive_p], c_int, check_int)
     except AttributeError:  # pragma: no cover
-        logger.warning('write filter "%s" is not supported' % f_name)
+        logger.info('write filter "%s" is not supported' % f_name)
         WRITE_FILTERS.remove(f_name)
 
 ffi('write_open',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/libarchive/write.py 
new/libarchive-c-2.9/libarchive/write.py
--- old/libarchive-c-2.8/libarchive/write.py    2018-06-10 15:27:14.000000000 
+0200
+++ new/libarchive-c-2.9/libarchive/write.py    2019-10-20 14:34:28.000000000 
+0200
@@ -77,25 +77,40 @@
 
     def add_file_from_memory(
             self, entry_path, entry_size, entry_data,
-            filetype=REGULAR_FILE,
-            permission=DEFAULT_UNIX_PERMISSION
+            filetype=REGULAR_FILE, permission=DEFAULT_UNIX_PERMISSION,
+            atime=None, mtime=None, ctime=None, birthtime=None,
     ):
         """"Add file from memory to archive.
 
         :param entry_path: where entry should be places in archive
         :type entry_path: str
-        :param entry_size: entire size of entry
+        :param entry_size: entire size of entry in bytes
         :type entry_size: int
         :param entry_data: content of entry
-        :type entry_data: iterable
+        :type entry_data: bytes or Iterable[bytes]
         :param filetype: which type of file: normal, symlink etc.
         should entry be created as
         :type filetype: octal number
         :param permission: with which permission should entry be created
         :type permission: octal number
+        :param atime: Last access time
+        :type atime: int seconds or tuple (int seconds, int nanoseconds)
+        :param mtime: Last modified time
+        :type mtime: int seconds or tuple (int seconds, int nanoseconds)
+        :param ctime: Creation time
+        :type ctime: int seconds or tuple (int seconds, int nanoseconds)
+        :param birthtime: Birth time (for archive formats that support it)
+        :type birthtime: int seconds or tuple (int seconds, int nanoseconds)
         """
         archive_pointer = self._pointer
 
+        if isinstance(entry_data, bytes):
+            entry_data = (entry_data,)
+        elif isinstance(entry_data, str):
+            raise TypeError(
+                "entry_data: expected bytes, got %r" % type(entry_data)
+            )
+
         with new_archive_entry() as archive_entry_pointer:
             archive_entry = ArchiveEntry(None, archive_entry_pointer)
 
@@ -103,6 +118,23 @@
             entry_set_size(archive_entry_pointer, entry_size)
             entry_set_filetype(archive_entry_pointer, filetype)
             entry_set_perm(archive_entry_pointer, permission)
+
+            if atime is not None:
+                if not isinstance(atime, tuple):
+                    atime = (atime, 0)
+                archive_entry.set_atime(*atime)
+            if mtime is not None:
+                if not isinstance(mtime, tuple):
+                    mtime = (mtime, 0)
+                archive_entry.set_mtime(*mtime)
+            if ctime is not None:
+                if not isinstance(ctime, tuple):
+                    ctime = (ctime, 0)
+                archive_entry.set_ctime(*ctime)
+            if birthtime is not None:
+                if not isinstance(birthtime, tuple):
+                    birthtime = (birthtime, 0)
+                archive_entry.set_birthtime(*birthtime)
             write_header(archive_pointer, archive_entry_pointer)
 
             for chunk in entry_data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/libarchive_c.egg-info/PKG-INFO 
new/libarchive-c-2.9/libarchive_c.egg-info/PKG-INFO
--- old/libarchive-c-2.8/libarchive_c.egg-info/PKG-INFO 2018-06-10 
15:30:39.000000000 +0200
+++ new/libarchive-c-2.9/libarchive_c.egg-info/PKG-INFO 2019-10-20 
14:40:31.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 2.1
 Name: libarchive-c
-Version: 2.8
+Version: 2.9
 Summary: Python interface to libarchive
 Home-page: https://github.com/Changaco/python-libarchive-c
 Author: Changaco
@@ -22,11 +22,21 @@
         Compatibility
         =============
         
+        python
+        ------
+        
         python-libarchive-c is currently tested with python 2.7, 3.4, 3.5, and 
3.6.
         
         If you find an incompatibility with older versions you can send us a 
small patch,
         but we won't accept big changes.
         
+        libarchive
+        ----------
+        
+        python-libarchive-c may not work properly with obsolete versions of 
libarchive such as the ones included in MacOS. In that case you can install a 
recent version of libarchive (e.g. with ``brew install libarchive`` on MacOS) 
and use the ``LIBARCHIVE`` environment variable to point python-libarchive-c to 
it::
+        
+            export 
LIBARCHIVE=/usr/local/Cellar/libarchive/3.3.3/lib/libarchive.13.dylib
+        
         Usage
         =====
         
@@ -68,3 +78,4 @@
         
 Keywords: archive libarchive 7z tar bz2 zip gz
 Platform: UNKNOWN
+Description-Content-Type: text/x-rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/setup.cfg 
new/libarchive-c-2.9/setup.cfg
--- old/libarchive-c-2.8/setup.cfg      2018-06-10 15:30:39.000000000 +0200
+++ new/libarchive-c-2.9/setup.cfg      2019-10-20 14:40:31.000000000 +0200
@@ -3,7 +3,7 @@
 
 [flake8]
 exclude = .?*,env*/
-ignore = E226,E731
+ignore = E226,E731,W504
 max-line-length = 80
 
 [egg_info]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/setup.py 
new/libarchive-c-2.9/setup.py
--- old/libarchive-c-2.8/setup.py       2016-11-29 19:03:27.000000000 +0100
+++ new/libarchive-c-2.9/setup.py       2019-10-20 14:39:01.000000000 +0200
@@ -17,5 +17,6 @@
     license='CC0',
     packages=find_packages(exclude=['tests']),
     long_description=open(join(dirname(__file__), 'README.rst')).read(),
+    long_description_content_type='text/x-rst',
     keywords='archive libarchive 7z tar bz2 zip gz',
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/tests/__init__.py 
new/libarchive-c-2.9/tests/__init__.py
--- old/libarchive-c-2.8/tests/__init__.py      2018-06-10 13:44:59.000000000 
+0200
+++ new/libarchive-c-2.9/tests/__init__.py      2019-10-20 13:18:23.000000000 
+0200
@@ -6,6 +6,10 @@
 from os.path import abspath, dirname, join
 from stat import S_ISREG
 import tarfile
+try:
+    from stat import filemode
+except ImportError:  # Python 2
+    filemode = tarfile.filemode
 
 from libarchive import file_reader
 
@@ -83,7 +87,7 @@
                 path += '/'
             # libarchive introduces prefixes such as h prefix for
             # hardlinks: tarfile does not, so we ignore the first char
-            mode = tarfile.filemode(entry.mode)[1:]
+            mode = filemode(entry.mode)[1:]
             yield {
                 'path': path,
                 'mtime': entry.mtime,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/tests/test_entry.py 
new/libarchive-c-2.9/tests/test_entry.py
--- old/libarchive-c-2.8/tests/test_entry.py    2018-06-10 13:44:59.000000000 
+0200
+++ new/libarchive-c-2.9/tests/test_entry.py    2019-10-20 13:18:23.000000000 
+0200
@@ -7,12 +7,15 @@
 import locale
 from os import environ, stat
 from os.path import join
+import unicodedata
 
 from libarchive import memory_reader, memory_writer
 
 from . import data_dir, get_entries, get_tarinfos
 
 
+text_type = unicode if str is bytes else str  # noqa: F821
+
 locale.setlocale(locale.LC_ALL, '')
 
 # needed for sane time stamp comparison
@@ -93,4 +96,9 @@
         for key in ignore:
             e1.pop(key)
             e2.pop(key)
+        # Normalize all unicode (can vary depending on the system)
+        for d in (e1, e2):
+            for key in d:
+                if isinstance(d[key], text_type):
+                    d[key] = unicodedata.normalize('NFC', d[key])
         assert e1 == e2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/tests/test_rwx.py 
new/libarchive-c-2.9/tests/test_rwx.py
--- old/libarchive-c-2.8/tests/test_rwx.py      2018-06-10 15:01:15.000000000 
+0200
+++ new/libarchive-c-2.9/tests/test_rwx.py      2019-10-20 14:34:28.000000000 
+0200
@@ -1,12 +1,16 @@
 """Test reading, writing and extracting archives."""
 
 from __future__ import division, print_function, unicode_literals
+
 import io
+import json
 
 import libarchive
+from libarchive.entry import format_time
 from libarchive.extract import EXTRACT_OWNER, EXTRACT_PERM, EXTRACT_TIME
 from libarchive.write import memory_writer
 from mock import patch
+import pytest
 
 from . import check_archive, in_dir, treestat
 
@@ -115,24 +119,48 @@
     assert not write_fail_mock.called
 
 
-def test_adding_entry_from_memory():
-    entry_path = 'this is path'
-    entry_data = 'content'
-    entry_size = len(entry_data)
[email protected](
+    'archfmt,data_bytes',
+    [('zip', b'content'),
+     ('gnutar', b''),
+     ('pax', json.dumps({'a': 1, 'b': 2, 'c': 3}).encode()),
+     ('7zip', b'lorem\0ipsum')])
+def test_adding_entry_from_memory(archfmt, data_bytes):
+    entry_path = 'testfile.data'
+    entry_data = data_bytes
+    entry_size = len(data_bytes)
 
     blocks = []
 
+    archfmt = 'zip'
+    has_birthtime = archfmt != 'zip'
+
+    atime = (1482144741, 495628118)
+    mtime = (1482155417, 659017086)
+    ctime = (1482145211, 536858081)
+    btime = (1482144740, 495628118) if has_birthtime else None
+
     def write_callback(data):
         blocks.append(data[:])
         return len(data)
 
-    with libarchive.custom_writer(write_callback, 'zip') as archive:
-        archive.add_file_from_memory(entry_path, entry_size, entry_data)
+    with libarchive.custom_writer(write_callback, archfmt) as archive:
+        archive.add_file_from_memory(
+            entry_path, entry_size, entry_data,
+            atime=atime, mtime=mtime, ctime=ctime, birthtime=btime
+        )
 
     buf = b''.join(blocks)
     with libarchive.memory_reader(buf) as memory_archive:
         for archive_entry in memory_archive:
-            assert entry_data.encode() == b''.join(
-                archive_entry.get_blocks()
-            )
+            expected = entry_data
+            actual = b''.join(archive_entry.get_blocks())
+            assert expected == actual
             assert archive_entry.path == entry_path
+            assert archive_entry.atime in (atime[0], format_time(*atime))
+            assert archive_entry.mtime in (mtime[0], format_time(*mtime))
+            assert archive_entry.ctime in (ctime[0], format_time(*ctime))
+            if has_birthtime:
+                assert archive_entry.birthtime in (
+                    btime[0], format_time(*btime)
+                )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libarchive-c-2.8/tox.ini new/libarchive-c-2.9/tox.ini
--- old/libarchive-c-2.8/tox.ini        2018-06-10 15:01:15.000000000 +0200
+++ new/libarchive-c-2.9/tox.ini        2019-10-20 13:18:23.000000000 +0200
@@ -1,11 +1,11 @@
 [tox]
-envlist=py27,py34,py35,py36
+envlist=py27,py35,py36,py37,py38
 skipsdist=True
 
 [testenv]
 passenv = LIBARCHIVE
 commands=
-    python -m pytest -vv --boxed --cov libarchive --cov-report term-missing 
{toxinidir}/tests {posargs}
+    python -m pytest -Wd -vv --boxed --cov libarchive --cov-report 
term-missing {toxinidir}/tests {posargs}
     flake8 {toxinidir}
 deps=
     flake8


Reply via email to