Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-djvulibre for 
openSUSE:Factory checked in at 2021-03-10 08:56:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-djvulibre (Old)
 and      /work/SRC/openSUSE:Factory/.python-djvulibre.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-djvulibre"

Wed Mar 10 08:56:34 2021 rev:22 rq:877753 version:0.8.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-djvulibre/python-djvulibre.changes        
2019-11-06 14:04:56.492712902 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-djvulibre.new.2378/python-djvulibre.changes  
    2021-03-10 08:58:15.910951526 +0100
@@ -1,0 +2,16 @@
+Mon Mar  8 13:48:17 UTC 2021 - Kyrill Detinov <[email protected]>
+
+- Update to 0.8.6.
+  * Fix build failure with Python 3.10.
+    + Require Cython >= 0.19.1 for Python 2.X.
+    + Drop support for Python 3.2 (and earlier 3.X versions).
+  * Fix build failure with Cython >= 3.0.
+  * Fix excessive memory use in djvu2png.
+  * Fix typo in an error message.
+  * Use HTTPS for cython.org URL.
+  * Improve the test suite.
+  * Improve the build system:
+    + Improve error handling.
+    + Declare build-dependencies.
+
+-------------------------------------------------------------------

Old:
----
  python-djvulibre-0.8.5.tar.gz
  python-djvulibre-0.8.5.tar.gz.asc

New:
----
  python-djvulibre-0.8.6.tar.gz
  python-djvulibre-0.8.6.tar.gz.asc

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

Other differences:
------------------
++++++ python-djvulibre.spec ++++++
--- /var/tmp/diff_new_pack.aBlW6n/_old  2021-03-10 08:58:16.582952220 +0100
+++ /var/tmp/diff_new_pack.aBlW6n/_new  2021-03-10 08:58:16.582952220 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-djvulibre
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-djvulibre
-Version:        0.8.5
+Version:        0.8.6
 Release:        0
 Summary:        Python Support for the DjVu Image Format
 License:        GPL-2.0-only
@@ -27,7 +27,7 @@
 Source0:        
https://files.pythonhosted.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz
 Source1:        
https://files.pythonhosted.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz.asc
 Source2:        %{name}.keyring
-BuildRequires:  %{python_module Cython >= 0.19}
+BuildRequires:  %{python_module Cython >= 0.19.1}
 BuildRequires:  %{python_module Sphinx}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module nose}

++++++ python-djvulibre-0.8.5.tar.gz -> python-djvulibre-0.8.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/MANIFEST.in 
new/python-djvulibre-0.8.6/MANIFEST.in
--- old/python-djvulibre-0.8.5/MANIFEST.in      2019-09-23 18:48:31.000000000 
+0200
+++ new/python-djvulibre-0.8.6/MANIFEST.in      2021-02-26 17:07:50.000000000 
+0100
@@ -1,7 +1,7 @@
 include MANIFEST.in
 
-include COPYING
 exclude README.rst
+include COPYING
 include doc/COPYING
 include doc/README
 include doc/api/*.rst
@@ -9,6 +9,7 @@
 include doc/changelog
 include doc/credits
 include doc/todo
+include pyproject.toml
 
 include examples/*
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/PKG-INFO 
new/python-djvulibre-0.8.6/PKG-INFO
--- old/python-djvulibre-0.8.5/PKG-INFO 2019-09-23 18:56:00.000000000 +0200
+++ new/python-djvulibre-0.8.6/PKG-INFO 2021-03-04 21:29:58.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: python-djvulibre
-Version: 0.8.5
+Version: 0.8.6
 Summary: Python support for the DjVu image format
 Home-page: http://jwilk.net/software/python-djvulibre
 Author: Jakub Wilk
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/djvu/__init__.py 
new/python-djvulibre-0.8.6/djvu/__init__.py
--- old/python-djvulibre-0.8.5/djvu/__init__.py 2016-06-08 23:34:06.000000000 
+0200
+++ new/python-djvulibre-0.8.6/djvu/__init__.py 2021-03-01 12:53:26.000000000 
+0100
@@ -1,6 +1,6 @@
 # encoding=UTF-8
 
-# Copyright ?? 2015 Jakub Wilk <[email protected]>
+# Copyright ?? 2015-2021 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -13,9 +13,7 @@
 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 # more details.
 
-import sys
-
-if sys.version_info < (2, 6):
-    raise RuntimeError('Python >= 2.6 is required')
+type(b'')  # Python >= 2.6 is required
+type(u'')  # Python 2.X or >= 3.3 is required
 
 # vim:ts=4 sts=4 sts=4 sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/djvu/decode.pxd 
new/python-djvulibre-0.8.6/djvu/decode.pxd
--- old/python-djvulibre-0.8.5/djvu/decode.pxd  2019-09-23 18:48:31.000000000 
+0200
+++ new/python-djvulibre-0.8.6/djvu/decode.pxd  2021-02-26 17:07:50.000000000 
+0100
@@ -1,4 +1,4 @@
-# Copyright ?? 2007-2018 Jakub Wilk <[email protected]>
+# Copyright ?? 2007-2020 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -203,8 +203,8 @@
     cdef object _queue
     cdef object _condition
     cdef object __weakref__
-    cdef object __init(self, Context context, ddjvu_document_t* ddjvu_document)
-    cdef object __clear(self)
+    cdef object _init(self, Context context, ddjvu_document_t* ddjvu_document)
+    cdef object _clear(self)
 
 cdef class _SexprWrapper:
     cdef object _document_weakref
@@ -285,8 +285,8 @@
     cdef ddjvu_job_t* ddjvu_job
     cdef object _queue
     cdef object _condition
-    cdef object __init(self, Context context, ddjvu_job_t *ddjvu_job)
-    cdef object __clear(self)
+    cdef object _init(self, Context context, ddjvu_job_t *ddjvu_job)
+    cdef object _clear(self)
     cdef object __weakref__
 
 cdef class PageJob(Job):
@@ -297,7 +297,7 @@
 
 cdef class DocumentDecodingJob(Job):
     cdef object _document
-    cdef object __init_ddj(self, Document document)
+    cdef object _init_ddj(self, Document document)
 
 cdef class AffineTransform:
     cdef ddjvu_rectmapper_t* ddjvu_rectmapper
@@ -308,7 +308,7 @@
     cdef Document _document
     cdef PageJob _page_job
     cdef Job _job
-    cdef object __init(self)
+    cdef object _init(self)
 
 cdef class ErrorMessage(Message):
     cdef object _message
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/djvu/decode.pyx 
new/python-djvulibre-0.8.6/djvu/decode.pyx
--- old/python-djvulibre-0.8.5/djvu/decode.pyx  2019-09-23 18:48:31.000000000 
+0200
+++ new/python-djvulibre-0.8.6/djvu/decode.pyx  2021-03-03 17:24:18.000000000 
+0100
@@ -1,4 +1,4 @@
-# Copyright ?? 2007-2019 Jakub Wilk <[email protected]>
+# Copyright ?? 2007-2021 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -59,6 +59,10 @@
 from os import devnull
 from traceback import format_exc
 
+IF PY3K:
+    cdef object memoryview
+    from builtins import memoryview
+
 cdef object StringIO
 IF PY3K:
     from io import StringIO
@@ -414,7 +418,7 @@
             return
         if not wait:
             return self._get_info()
-        while 1:
+        while True:
             self._document._condition.acquire()
             try:
                 status = 
ddjvu_document_get_pageinfo(self._document.ddjvu_document, self._n, 
&self.ddjvu_pageinfo)
@@ -539,7 +543,7 @@
             if ddjvu_document_decoding_error(self._document.ddjvu_document):
                 raise 
JobException_from_c(ddjvu_document_decoding_status(self._document.ddjvu_document))
             job = PageJob(sentinel = the_sentinel)
-            job.__init(self._document._context, ddjvu_job)
+            job._init(self._document._context, ddjvu_job)
         finally:
             release_lock(loft_lock)
         if wait:
@@ -641,7 +645,7 @@
             result = None
             memory = NULL
         else:
-            result = allocate_image_memory(row_size, h, buffer, &memory)
+            (result, memview) = allocate_image_memory(row_size, h, buffer, 
&memory)
         if ddjvu_thumbnail_render(self._page._document.ddjvu_document, 
self._page._n, &iw, &ih, pixel_format.ddjvu_format, row_size, <char*> memory):
             return (iw, ih, row_size), result
         else:
@@ -758,7 +762,7 @@
             return
         if not wait:
             return self._get_info()
-        while 1:
+        while True:
             self._document._condition.acquire()
             try:
                 status = 
ddjvu_document_get_fileinfo(self._document.ddjvu_document, self._n, 
&self.ddjvu_fileinfo)
@@ -960,7 +964,7 @@
     Use document.decoding_job to obtain instances of this class.
     '''
 
-    cdef object __init_ddj(self, Document document):
+    cdef object _init_ddj(self, Document document):
         self._context = document._context
         self._document = document
         self._condition = document._condition
@@ -993,7 +997,7 @@
         self._queue = Queue()
         self._condition = Condition()
 
-    cdef object __init(self, Context context, ddjvu_document_t 
*ddjvu_document):
+    cdef object _init(self, Context context, ddjvu_document_t *ddjvu_document):
         # Assumption: loft_lock is already acquired.
         assert (context is not None) and ddjvu_document != NULL
         self.ddjvu_document = ddjvu_document
@@ -1001,7 +1005,7 @@
         _document_loft.add(self)
         _document_weak_loft[voidp_to_int(ddjvu_document)] = self
 
-    cdef object __clear(self):
+    cdef object _clear(self):
         with nogil:
             acquire_lock(loft_lock, WAIT_LOCK)
         try:
@@ -1037,7 +1041,7 @@
         def __get__(self):
             cdef DocumentDecodingJob job
             job = DocumentDecodingJob(sentinel = the_sentinel)
-            job.__init_ddj(self)
+            job._init_ddj(self)
             return job
 
     property type:
@@ -1133,7 +1137,7 @@
             acquire_lock(loft_lock, WAIT_LOCK)
         try:
             job = SaveJob(sentinel = the_sentinel)
-            job.__init(self._context, ddjvu_document_save(self.ddjvu_document, 
output, optc, optv))
+            job._init(self._context, ddjvu_document_save(self.ddjvu_document, 
output, optc, optv))
             job._file = file_wrapper
         finally:
             release_lock(loft_lock)
@@ -1335,7 +1339,7 @@
                 acquire_lock(loft_lock, WAIT_LOCK)
             try:
                 job = SaveJob(sentinel = the_sentinel)
-                job.__init(
+                job._init(
                     self._context,
                     ddjvu_document_print(self.ddjvu_document, output, 
len(options), optv)
                 )
@@ -1403,7 +1407,7 @@
     cdef ddjvu_message_t* ddjvu_message
 
     check_sentinel(self, kwargs)
-    while 1:
+    while True:
         with nogil:
             ddjvu_message = ddjvu_message_wait(self.ddjvu_context)
         try:
@@ -1423,7 +1427,7 @@
                 finally:
                     job._condition.release()
                 if job.is_done:
-                    job.__clear()
+                    job._clear()
             elif message._page_job is not None:
                 raise SystemError  # should not happen
             elif message._document is not None:
@@ -1434,7 +1438,7 @@
                 finally:
                     document._condition.release()
                 if document.decoding_done:
-                    document.__clear()
+                    document._clear()
         except KeyboardInterrupt:
             return
         except SystemExit:
@@ -1569,7 +1573,7 @@
             if ddjvu_document == NULL:
                 raise JobFailed
             document = Document(sentinel = the_sentinel)
-            document.__init(self, ddjvu_document)
+            document._init(self, ddjvu_document)
         finally:
             release_lock(loft_lock)
         return document
@@ -1928,6 +1932,7 @@
     return result
 
 cdef object allocate_image_memory(long width, long height, object buffer, void 
**memory):
+    cdef char[::1] memview = None
     cdef Py_ssize_t c_requested_size
     cdef Py_ssize_t c_memory_size
     py_requested_size = int(width) * int(height)
@@ -1940,10 +1945,16 @@
         memory[0] = <char*> result
     else:
         result = buffer
-        buffer_to_writable_memory(buffer, memory, &c_memory_size)
-        if c_memory_size < c_requested_size:
-            raise ValueError('Image buffer is too small ({0} > 
{1})'.format(c_requested_size, c_memory_size))
-    return result
+        IF PY3K:
+            memview = memoryview(buffer).cast('c')
+            if len(memview) < c_requested_size:
+                raise ValueError('Image buffer is too small ({0} > 
{1})'.format(c_requested_size, len(memview)))
+            memory[0] = &memview[0]
+        ELSE:
+            buffer_to_writable_memory(buffer, memory, &c_memory_size)
+            if c_memory_size < c_requested_size:
+                raise ValueError('Image buffer is too small ({0} > 
{1})'.format(c_requested_size, c_memory_size))
+    return (result, memview)
 
 
 cdef class PageJob(Job):
@@ -1954,8 +1965,8 @@
     Use page.decode(...) to obtain instances of this class.
     '''
 
-    cdef object __init(self, Context context, ddjvu_job_t *ddjvu_job):
-        Job.__init(self, context, ddjvu_job)
+    cdef object _init(self, Context context, ddjvu_job_t *ddjvu_job):
+        Job._init(self, context, ddjvu_job)
 
     property width:
         '''
@@ -2152,7 +2163,7 @@
             raise ValueError('page_rect width/height must be a positive 
integer')
         c_page_rect.x, c_page_rect.y, c_page_rect.w, c_page_rect.h = x, y, w, h
         if c_page_rect.x != x or c_page_rect.y != y or c_page_rect.w != w or 
c_page_rect.h != h:
-            raise OverflowError('render_rect coordinates are too large')
+            raise OverflowError('page_rect coordinates are too large')
         x, y, w, h = render_rect
         if w <= 0 or h <= 0:
             raise ValueError('render_rect width/height must be a positive 
integer')
@@ -2167,7 +2178,7 @@
         ):
             raise ValueError('render_rect must be inside page_rect')
         row_size = calculate_row_size(c_render_rect.w, row_alignment, 
pixel_format._bpp)
-        result = allocate_image_memory(row_size, c_render_rect.h, buffer, 
&memory)
+        (result, memview) = allocate_image_memory(row_size, c_render_rect.h, 
buffer, &memory)
         if ddjvu_page_render(<ddjvu_page_t*> self.ddjvu_job, mode, 
&c_page_rect, &c_render_rect, pixel_format.ddjvu_format, row_size, <char*> 
memory) == 0:
             raise _NotAvailable_
         return result
@@ -2196,7 +2207,7 @@
         self._condition = Condition()
         self._queue = Queue()
 
-    cdef object __init(self, Context context, ddjvu_job_t *ddjvu_job):
+    cdef object _init(self, Context context, ddjvu_job_t *ddjvu_job):
         # Assumption: loft_lock is already acquired.
         assert (context is not None) and ddjvu_job != NULL
         self._context = context
@@ -2204,7 +2215,7 @@
         _job_loft.add(self)
         _job_weak_loft[voidp_to_int(ddjvu_job)] = self
 
-    cdef object __clear(self):
+    cdef object _clear(self):
         with nogil:
             acquire_lock(loft_lock, WAIT_LOCK)
         try:
@@ -2239,7 +2250,7 @@
 
         Wait until the job is done.
         '''
-        while 1:
+        while True:
             self._condition.acquire()
             try:
                 if ddjvu_job_done(self.ddjvu_job):
@@ -2434,7 +2445,7 @@
         check_sentinel(self, kwargs)
         self.ddjvu_message = NULL
 
-    cdef object __init(self):
+    cdef object _init(self):
         if self.ddjvu_message == NULL:
             raise SystemError
         self._context = Context_from_c(self.ddjvu_message.m_any.context)
@@ -2477,8 +2488,8 @@
     because they can occur asynchronously.
     '''
 
-    cdef object __init(self):
-        Message.__init(self)
+    cdef object _init(self):
+        Message._init(self)
         IF HAVE_LANGINFO_H:
             locale_encoding = charp_to_string(nl_langinfo(CODESET))
         ELSE:
@@ -2547,8 +2558,8 @@
     decoding process. This might be displayed in the browser status bar.
     '''
 
-    cdef object __init(self):
-        Message.__init(self)
+    cdef object _init(self):
+        Message._init(self)
         self._message = charp_to_string(self.ddjvu_message.m_error.message)
 
     property message:
@@ -2644,8 +2655,8 @@
 
     '''
 
-    cdef object __init(self):
-        Message.__init(self)
+    cdef object _init(self):
+        Message._init(self)
         self._stream = Stream(self.document, 
self.ddjvu_message.m_newstream.streamid, sentinel = the_sentinel)
         self._name = charp_to_string(self.ddjvu_message.m_newstream.name)
         self._uri = charp_to_string(self.ddjvu_message.m_newstream.url)
@@ -2731,8 +2742,8 @@
     A ThumbnailMessage is sent when additional thumbnails are available.
     '''
 
-    cdef object __init(self):
-        Message.__init(self)
+    cdef object _init(self):
+        Message._init(self)
         self._page_no = self.ddjvu_message.m_thumbnail.pagenum
 
     property thumbnail:
@@ -2752,8 +2763,8 @@
     completion of a print or save job.
     '''
 
-    cdef object __init(self):
-        Message.__init(self)
+    cdef object _init(self):
+        Message._init(self)
         self._percent = self.ddjvu_message.m_progress.percent
         self._status = self.ddjvu_message.m_progress.status
 
@@ -2795,7 +2806,7 @@
         raise SystemError
     message = klass(sentinel = the_sentinel)
     message.ddjvu_message = ddjvu_message
-    message.__init()
+    message._init()
     return message
 
 cdef object JOB_EXCEPTION_MAP
@@ -2912,7 +2923,7 @@
 
         Wait until the associated S-expression is available.
         '''
-        while 1:
+        while True:
             self._document._condition.acquire()
             try:
                 try:
@@ -2974,7 +2985,7 @@
 
         Wait until the associated S-expression is available.
         '''
-        while 1:
+        while True:
             self._document._condition.acquire()
             try:
                 try:
@@ -3244,7 +3255,7 @@
 
         Wait until the associated S-expression is available.
         '''
-        while 1:
+        while True:
             self._page._document._condition.acquire()
             try:
                 try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/djvu/sexpr.pyx 
new/python-djvulibre-0.8.6/djvu/sexpr.pyx
--- old/python-djvulibre-0.8.5/djvu/sexpr.pyx   2019-09-23 18:48:31.000000000 
+0200
+++ new/python-djvulibre-0.8.6/djvu/sexpr.pyx   2021-02-26 17:07:50.000000000 
+0100
@@ -834,7 +834,7 @@
                 n = n + len(self)
             if n < 0:
                 raise IndexError('list index of out range')
-            while 1:
+            while True:
                 if cexpr == cexpr_nil:
                     raise IndexError('list index of out range')
                 if n > 0:
@@ -872,7 +872,7 @@
                 n = n + len(self)
             if n < 0:
                 raise IndexError('list index of out range')
-            while 1:
+            while True:
                 if cexpr == cexpr_nil:
                     raise IndexError('list index of out range')
                 if n > 0:
@@ -941,7 +941,7 @@
             finally:
                 gc_unlock(NULL)
             return
-        while 1:
+        while True:
             assert cexpr != cexpr_nil
             if index > 1 and cexpr_tail(cexpr) != cexpr_nil:
                 index = index - 1
@@ -999,7 +999,7 @@
         if _c2py(cexpr_head(cexpr)) == item:
             self.wexpr = wexpr(cexpr_tail(cexpr))
             return
-        while 1:
+        while True:
             assert cexpr != cexpr_nil
             if cexpr_tail(cexpr) == cexpr_nil:
                 raise IndexError('item not in list')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/doc/README 
new/python-djvulibre-0.8.6/doc/README
--- old/python-djvulibre-0.8.5/doc/README       2019-09-23 18:48:31.000000000 
+0200
+++ new/python-djvulibre-0.8.6/doc/README       2021-03-01 12:53:26.000000000 
+0100
@@ -15,8 +15,8 @@
 The following software is required to build python-djvulibre:
 
 * DjVuLibre (??? 3.5.21)
-* Python_ (??? 2.6 or 3.X)
-* Cython_ (??? 0.19, or ??? 0.20 for Python 3)
+* Python_ (2.6, 2.7 or ??? 3.3)
+* Cython_ (??? 0.19.1, or ??? 0.20 for Python 3)
 * pkg-config_ (required on POSIX systems)
 
 Additionally, the following software is needed to run the tests:
@@ -29,7 +29,7 @@
 .. _Python:
    https://www.python.org/
 .. _Cython:
-   http://cython.org/
+   https://cython.org/
 .. _pkg-config:
    https://wiki.freedesktop.org/www/Software/pkg-config/
 .. _nose:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/doc/changelog 
new/python-djvulibre-0.8.6/doc/changelog
--- old/python-djvulibre-0.8.5/doc/changelog    2019-09-23 18:51:44.000000000 
+0200
+++ new/python-djvulibre-0.8.6/doc/changelog    2021-03-04 21:26:05.000000000 
+0100
@@ -1,3 +1,22 @@
+python-djvulibre (0.8.6) unstable; urgency=low
+
+  * Fix build failure with Python 3.10.
+    Thanks to Audrey Yeena Toskin for the bug report.
+    https://github.com/jwilk/python-djvulibre/issues/13
+    + Require Cython >= 0.19.1 for Python 2.X.
+    + Drop support for Python 3.2 (and earlier 3.X versions).
+  * Fix build failure with Cython >= 3.0.
+  * Fix excessive memory use in djvu2png.
+  * Fix typo in an error message.
+  * Use HTTPS for cython.org URL.
+  * Improve the test suite.
+  * Improve the build system:
+    + Improve error handling.
+      https://github.com/jwilk/python-djvulibre/issues/12
+    + Declare build-dependencies (as per PEP-518).
+
+ -- Jakub Wilk <[email protected]>  Thu, 04 Mar 2021 21:26:02 +0100
+
 python-djvulibre (0.8.5) unstable; urgency=low
 
   * Improve the setup script:
@@ -53,7 +72,6 @@
   * Explicitly set Cython's Python language level to 2.
     This might fix build failures with future versions of Cython.
   * Improve the build system:
-    + Declare build-dependencies (as per PEP-518).
     + Add the bdist_wheel command.
     + Use distutils644 to normalize tarball permissions etc.
     + Fix Python version check.
@@ -303,7 +321,7 @@
   * Improve setup.py:
     + Add work-around for <https://bugs.debian.org/607112>.
     + Make ???clean --all??? remove temporary *.pxi and *.c files.
-    + Don't import Cython modules; calls the ???cython??? binary instead.
+    + Don't import Cython modules; call the ???cython??? binary instead.
     + Allow cross-compilation using MinGW cross compiler.
 
  -- Jakub Wilk <[email protected]>  Wed, 15 Dec 2010 21:17:39 +0100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/examples/djvu2png 
new/python-djvulibre-0.8.6/examples/djvu2png
--- old/python-djvulibre-0.8.5/examples/djvu2png        2019-09-23 
18:48:31.000000000 +0200
+++ new/python-djvulibre-0.8.6/examples/djvu2png        2021-03-01 
12:53:26.000000000 +0100
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # encoding=UTF-8
 
-# Copyright ?? 2010-2018 Jakub Wilk <[email protected]>
+# Copyright ?? 2010-2021 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -46,9 +46,10 @@
             width, height = page_job.size
             rect = (0, 0, width, height)
             bytes_per_line = 
cairo.ImageSurface.format_stride_for_width(cairo_pixel_format, width)
-            color_buffer = numpy.zeros((height, bytes_per_line), 
dtype=numpy.uint32)
+            assert bytes_per_line % 4 == 0
+            color_buffer = numpy.zeros((height, bytes_per_line // 4), 
dtype=numpy.uint32)
             page_job.render(mode, rect, rect, djvu_pixel_format, 
row_alignment=bytes_per_line, buffer=color_buffer)
-            mask_buffer = numpy.zeros((height, bytes_per_line), 
dtype=numpy.uint32)
+            mask_buffer = numpy.zeros((height, bytes_per_line // 4), 
dtype=numpy.uint32)
             if mode == djvu.decode.RENDER_FOREGROUND:
                 page_job.render(djvu.decode.RENDER_MASK_ONLY, rect, rect, 
djvu_pixel_format, row_alignment=bytes_per_line, buffer=mask_buffer)
                 mask_buffer <<= 24
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/pyproject.toml 
new/python-djvulibre-0.8.6/pyproject.toml
--- old/python-djvulibre-0.8.5/pyproject.toml   1970-01-01 01:00:00.000000000 
+0100
+++ new/python-djvulibre-0.8.6/pyproject.toml   2021-03-01 12:53:26.000000000 
+0100
@@ -0,0 +1,8 @@
+[build-system]
+requires = [
+    'setuptools', 'wheel',  # needed only to make pip happy
+    'Cython>=0.19.1; python_version<"3"',
+    'Cython>=0.20; python_version>="3"',
+]
+
+# vim:ts=4 sts=4 sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/setup.py 
new/python-djvulibre-0.8.6/setup.py
--- old/python-djvulibre-0.8.5/setup.py 2019-09-23 18:48:31.000000000 +0200
+++ new/python-djvulibre-0.8.6/setup.py 2021-03-01 12:53:26.000000000 +0100
@@ -1,6 +1,6 @@
 # encoding=UTF-8
 
-# Copyright ?? 2007-2019 Jakub Wilk <[email protected]>
+# Copyright ?? 2007-2021 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -62,6 +62,7 @@
     distutils644.install()
 
 type(b'')  # Python >= 2.6 is required
+type(u'')  # Python 2.X or >= 3.3 is required
 
 def ext_modules():
     for pyx_file in glob.iglob(os.path.join('djvu', '*.pyx')):
@@ -90,8 +91,9 @@
     stdout = stdout.decode('ASCII')
     stderr = stderr.decode('ASCII', 'replace')
     if pkgconfig.returncode != 0:
-        msg = 'pkg-config failed: {msg}'.format(msg=stderr.strip())
-        distutils.log.warn(msg)
+        distutils.log.warn('pkg-config failed:')
+        for line in stderr.splitlines():
+            distutils.log.warn('  ' + line)
         return
     return stdout
 
@@ -137,7 +139,7 @@
     version = pkgconfig_version('ddjvuapi')
     if version is None:
         if os.name == 'posix':
-            raise RuntimeError('cannot determine DjVuLibre version')
+            raise distutils.errors.DistutilsError('cannot determine DjVuLibre 
version')
         elif os.name == 'nt':
             version = djvu.dllpath._guess_dll_version()
     version = version or '0'
@@ -160,7 +162,7 @@
 cython_version = get_cython_version()
 if str is bytes:
     # Python 2.X
-    req_cython_version = '0.19'
+    req_cython_version = '0.19.1'
 else:
     # Python 3.X
     req_cython_version = '0.20'
@@ -173,7 +175,12 @@
     def run(self):
         djvulibre_version = get_djvulibre_version()
         if djvulibre_version != '0' and djvulibre_version < '3.5.21':
-            raise RuntimeError('DjVuLibre >= 3.5.21 is required')
+            raise distutils.errors.DistutilsError('DjVuLibre >= 3.5.21 is 
required')
+        compiler_flags = pkgconfig_build_flags('ddjvuapi')
+        for extension in self.extensions:
+            for attr, flags in compiler_flags.items():
+                getattr(extension, attr)
+                setattr(extension, attr, flags)
         new_config = [
             'DEF PY3K = {0}'.format(sys.version_info >= (3, 0)),
             'DEF PYTHON_DJVULIBRE_VERSION = b"{0}"'.format(py_version),
@@ -217,7 +224,7 @@
             distutils.log.info('cythoning {ext.name!r} 
extension'.format(ext=ext))
             def build_c(source, target):
                 if cython_version < req_cython_version:
-                    raise RuntimeError('Cython >= {ver} is 
required'.format(ver=req_cython_version))
+                    raise distutils.errors.DistutilsError('Cython >= {ver} is 
required'.format(ver=req_cython_version))
                 distutils.spawn.spawn([
                     sys.executable, '-m', 'cython',
                     '-I', os.path.dirname(self.config_path),
@@ -257,8 +264,6 @@
         distutils.command.sdist.sdist.make_release_tree(self, base_dir, files)
         self.maybe_move_file(base_dir, 'COPYING', 'doc/COPYING')
 
-compiler_flags = pkgconfig_build_flags('ddjvuapi')
-
 classifiers = '''
 Development Status :: 4 - Beta
 Intended Audience :: Developers
@@ -293,7 +298,6 @@
             'djvu.{mod}'.format(mod=name),
             ['djvu/{mod}.pyx'.format(mod=name)],
             depends=(['djvu/common.pxi'] + glob.glob('djvu/*.pxd')),
-            **compiler_flags
         )
         for name in ext_modules
     ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-djvulibre-0.8.5/tests/test_decode.py 
new/python-djvulibre-0.8.6/tests/test_decode.py
--- old/python-djvulibre-0.8.5/tests/test_decode.py     2019-09-23 
18:48:31.000000000 +0200
+++ new/python-djvulibre-0.8.6/tests/test_decode.py     2021-02-26 
21:48:49.000000000 +0100
@@ -1,6 +1,6 @@
 # encoding=UTF-8
 
-# Copyright ?? 2007-2019 Jakub Wilk <[email protected]>
+# Copyright ?? 2007-2021 Jakub Wilk <[email protected]>
 #
 # This file is part of python-djvulibre.
 #
@@ -119,6 +119,9 @@
 else:
     array_tobytes = array.array.tostring
 
+if sys.version_info < (2, 7):
+    memoryview = None  # make pyflakes happy
+
 def run(*cmd, **kwargs):
     stdin = kwargs.pop('stdin', None)
     env = dict(os.environ)
@@ -547,6 +550,19 @@
         s = array_tobytes(buffer)
         assert_equal(s, 
b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xEF\xFF\xFF\xFF\xA4\xFF\xFF\xFF\xB8')
 
+        buffer = array.array('I', [0] * 4)
+        pixel_format = PixelFormatRgbMask(0xFF0000, 0xFF00, 0xFF, bpp=32)
+        assert_is(page_job.render(RENDER_COLOR, (0, 0, 10, 10), (0, 0, 2, 2), 
pixel_format, 1, buffer), buffer)
+        s = array_tobytes(buffer)
+        assert_equal(s, b'\xFF\xFF\xFF\x00' * 4)
+
+        if sys.version_info >= (3, 3):
+            buffer = bytearray(16)
+            memview = memoryview(buffer).cast('I', shape=(2, 2))
+            assert_is(page_job.render(RENDER_COLOR, (0, 0, 10, 10), (0, 0, 2, 
2), pixel_format, 1, memview), memview)
+            s = bytes(buffer)
+            assert_equal(s, b'\xFF\xFF\xFF\x00' * 4)
+
 class test_thumbnails:
 
     def test(self):

Reply via email to