Hello community, here is the log from the commit of package python-djvulibre for openSUSE:Factory checked in at 2016-08-15 10:31:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-djvulibre (Old) and /work/SRC/openSUSE:Factory/.python-djvulibre.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-djvulibre" Changes: -------- --- /work/SRC/openSUSE:Factory/python-djvulibre/python-djvulibre.changes 2016-05-23 16:39:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-djvulibre.new/python-djvulibre.changes 2016-08-15 10:31:59.000000000 +0200 @@ -1,0 +2,23 @@ +Thu Aug 11 11:05:04 UTC 2016 - [email protected] + +- Update to 0.8. + * Improve documentation: + + Fix doctests' compatibility with Python 3.6. + + Don't require TeX distribution to render math formulas. + + Simplify some module docstrings. + + Fix typos in docstrings. + + Update bug tracker URLs. The project repo has moved to + GitHub. + * Improve the setup script: + + Check Cython version. + + Use “python -m cython” instead of the “cython” script. + + Report build-time requirements to pip. + + Don't use setuptools, except on Windows. + + Remove poorly standardized “platforms” metadata key. (The + information about supported platform is available in the + “Operating System” classifiers.). + + Add the “Programming Language :: Cython” classifier. + * Don't hardcode the Python interpreter path in script shebangs; + use “#!/usr/bin/env python” instead. + +------------------------------------------------------------------- Old: ---- python-djvulibre-0.7.2.tar.gz python-djvulibre-0.7.2.tar.gz.asc New: ---- python-djvulibre-0.8.tar.gz python-djvulibre-0.8.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-djvulibre.spec ++++++ --- /var/tmp/diff_new_pack.hIsRko/_old 2016-08-15 10:32:00.000000000 +0200 +++ /var/tmp/diff_new_pack.hIsRko/_new 2016-08-15 10:32:00.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-djvulibre -Version: 0.7.2 +Version: 0.8 Release: 0 Summary: Python Support for the DjVu Image Format License: GPL-2.0 @@ -32,7 +32,6 @@ BuildRequires: python-Cython >= 0.19 BuildRequires: python-Sphinx BuildRequires: python-devel >= 2.6 -BuildRequires: python-setuptools BuildRequires: pkgconfig(ddjvuapi) >= 3.5.21 # Required for tests. BuildRequires: djvulibre ++++++ python-djvulibre-0.7.2.tar.gz -> python-djvulibre-0.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/PKG-INFO new/python-djvulibre-0.8/PKG-INFO --- old/python-djvulibre-0.7.2/PKG-INFO 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/PKG-INFO 2016-08-05 23:07:39.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-djvulibre -Version: 0.7.2 +Version: 0.8 Summary: Python support for the DjVu image format Home-page: http://jwilk.net/software/python-djvulibre Author: Jakub Wilk @@ -9,13 +9,13 @@ Description: *python-djvulibre* is a set of Python bindings for the `DjVuLibre <http://djvu.sourceforge.net/>`_ library, an open source implementation of `DjVu <http://djvu.org/>`_. -Platform: all +Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: POSIX -Classifier: Operating System :: Microsoft :: Windows :: Windows 95/98/2000 -Classifier: Operating System :: Microsoft :: Windows :: Windows NT/2000 +Classifier: Operating System :: Microsoft :: Windows +Classifier: Programming Language :: Cython Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/djvu/decode.pyx new/python-djvulibre-0.8/djvu/decode.pyx --- old/python-djvulibre-0.7.2/djvu/decode.pyx 2016-05-12 00:11:53.000000000 +0200 +++ new/python-djvulibre-0.8/djvu/decode.pyx 2016-08-01 22:16:19.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright © 2007-2015 Jakub Wilk <[email protected]> +# Copyright © 2007-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -14,7 +14,7 @@ #cython: autotestdict=False ''' -DjVuLibre bindings: module for efficiently decoding and displaying DjVu documents. +DjVuLibre bindings: module for efficiently decoding and displaying DjVu documents Summary ------- @@ -204,10 +204,13 @@ cdef extern from 'Python.h': FILE* file_to_cfile 'PyFile_AsFile'(object) int is_file 'PyFile_Check'(object) -from posix.unistd cimport dup +IF WINDOWS: + cdef extern from 'io.h' nogil: + int dup(int) +ELSE: + from posix.unistd cimport dup from libc.stdio cimport fclose -cdef extern from 'unistd.h': - FILE *fdopen(int, char*) +from libc.stdio cimport fdopen IF HAVE_LANGINFO_H: cdef extern from 'langinfo.h': @@ -1537,7 +1540,7 @@ which data is needed. The caller must then provide the raw data using a NewStreamMessage.stream object. - To open a local file, provide a FileUri instance as an uri. + To open a local file, provide a FileUri instance as a URI. Localized characters in uri should be in URI-encoded. @@ -2529,7 +2532,7 @@ cdef class InfoMessage(Message): ''' - A InfoMessage provides informational text indicating the progress of the + An InfoMessage provides informational text indicating the progress of the decoding process. This might be displayed in the browser status bar. ''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/djvu/dllpath.py new/python-djvulibre-0.8/djvu/dllpath.py --- old/python-djvulibre-0.7.2/djvu/dllpath.py 2015-08-18 10:36:08.000000000 +0200 +++ new/python-djvulibre-0.8/djvu/dllpath.py 2016-08-03 19:57:43.000000000 +0200 @@ -1,6 +1,6 @@ # encoding=UTF-8 -# Copyright © 2011 Jakub Wilk <[email protected]> +# Copyright © 2011-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -14,7 +14,7 @@ # more details. ''' -Module aimed to ease finding DjVuLibre DLLs in non-standard locations. +ease finding DjVuLibre DLLs in non-standard locations ''' import os @@ -22,37 +22,58 @@ if os.name != 'nt': raise ImportError('This module is for Windows only') -def guess_dll_path(): - import os +import ctypes + +try: + # Python 3.X + import winreg + unicode = str +except ImportError: + # Python 2.X import _winreg as winreg - registry = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - try: - key = winreg.OpenKey(registry, r'Software\Microsoft\Windows\CurrentVersion\Uninstall\DjVuLibre+DjView') - try: - value, tp = winreg.QueryValueEx(key, 'UninstallString') + +def _get(key, subkey): + unicode = type(b''.decode()) + with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as registry: + with winreg.OpenKey(registry, key) as regkey: + value, tp = winreg.QueryValueEx(regkey, subkey) + del tp if not isinstance(value, unicode): - return - path = os.path.dirname(value) - if os.path.isfile(os.path.join(path, 'libdjvulibre.dll')): - return path - finally: - winreg.CloseKey(key) - except WindowsError: + raise TypeError + return value + +_djvulibre_key = r'Software\Microsoft\Windows\CurrentVersion\Uninstall\DjVuLibre+DjView' + +def guess_dll_path(): + try: + path = _get(_djvulibre_key, 'UninstallString') + except (TypeError, WindowsError): + return + path = os.path.dirname(path) + if os.path.isfile(os.path.join(path, 'libdjvulibre.dll')): + return path + +def _guess_dll_version(): + try: + version = _get(_djvulibre_key, 'DisplayVersion') + except (TypeError, WindowsError): return - finally: - winreg.CloseKey(registry) + return version.split('+')[0] def set_dll_search_path(path=None): + unicode = type(b''.decode()) if path is None: path = guess_dll_path() if path is None: return if not isinstance(path, unicode): raise TypeError - import ctypes ctypes.windll.kernel32.SetDllDirectoryW(path) return path -del os +__all__ = [ + 'guess_dll_path', + 'set_dll_search_path' +] # vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/djvu/sexpr.pyx new/python-djvulibre-0.8/djvu/sexpr.pyx --- old/python-djvulibre-0.7.2/djvu/sexpr.pyx 2015-08-29 13:26:08.000000000 +0200 +++ new/python-djvulibre-0.8/djvu/sexpr.pyx 2016-08-01 11:56:38.000000000 +0200 @@ -119,8 +119,8 @@ cdef int (*backup_io_getc)() cdef int (*backup_io_ungetc)(int c) cdef int backup_io_7bit - cdef object stdin - cdef object stdout + cdef object stdin 'stdin_fp' + cdef object stdout 'stdout_fp' cdef int stdout_binary cdef object buffer cdef object exc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/doc/api/conf.py new/python-djvulibre-0.8/doc/api/conf.py --- old/python-djvulibre-0.7.2/doc/api/conf.py 2016-02-11 00:14:39.000000000 +0100 +++ new/python-djvulibre-0.8/doc/api/conf.py 2016-07-31 21:55:26.000000000 +0200 @@ -1,6 +1,6 @@ # encoding=UTF-8 -# Copyright © 2009-2015 Jakub Wilk <[email protected]> +# Copyright © 2009-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -13,15 +13,14 @@ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. -import os import codecs +import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.pngmath', 'sphinx.ext.inheritance_diagram', ] @@ -51,6 +50,7 @@ html_theme = 'haiku' html_use_modindex = True html_use_index = False +html_static_path = ['static'] rst_epilog = ''' .. |djvu3ref| replace:: Lizardtech DjVu Reference @@ -63,4 +63,11 @@ .. _djvuext: https://sourceforge.net/p/djvu/djvulibre-git/ci/release.3.5.23/tree/doc/djvuchanges.txt ''' +# With a bit of our help, docutils is capable of rendering our simple formulas. +# Sphinx math extension is not needed. +import sphinx.writers.html +del sphinx.writers.html.HTMLTranslator.visit_math +def setup(app): + app.add_stylesheet('docutils-math.css') + # vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/doc/api/expressions.rst new/python-djvulibre-0.8/doc/api/expressions.rst --- old/python-djvulibre-0.7.2/doc/api/expressions.rst 2016-03-11 21:51:39.000000000 +0100 +++ new/python-djvulibre-0.8/doc/api/expressions.rst 2016-06-09 01:21:19.000000000 +0200 @@ -84,7 +84,7 @@ >>> x Expression(42) >>> type(x) - <class 'djvu.sexpr.IntExpression'> + <class 'djvu.sexpr.IntExpression'...> >>> x.as_string() '42' >>> x.value @@ -99,7 +99,7 @@ >>> x Expression([4, 2]) >>> type(x) - <class 'djvu.sexpr.ListExpression'> + <class 'djvu.sexpr.ListExpression'...> >>> x.as_string() '(4 2)' >>> x.value @@ -116,7 +116,7 @@ >>> x Expression('eggs') >>> type(x) - <class 'djvu.sexpr.StringExpression'> + <class 'djvu.sexpr.StringExpression'...> >>> x.as_string() '"eggs"' >>> x.value @@ -131,7 +131,7 @@ >>> x Expression(Symbol('ham')) >>> type(x) - <class 'djvu.sexpr.SymbolExpression'> + <class 'djvu.sexpr.SymbolExpression'...> >>> x.as_string() 'ham' >>> x.value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/doc/changelog new/python-djvulibre-0.8/doc/changelog --- old/python-djvulibre-0.7.2/doc/changelog 2016-05-12 14:07:15.000000000 +0200 +++ new/python-djvulibre-0.8/doc/changelog 2016-08-05 22:52:26.000000000 +0200 @@ -1,3 +1,31 @@ +python-djvulibre (0.8) unstable; urgency=low + + * Fix Windows support. It is now possible to build the package using the + default compiler, Microsoft Visual C++ Compiler for Python. + https://github.com/jwilk/python-djvulibre/issues/1 + + Remove support for cross-compiling using MinGW. + * Fix test failures on non-Linux systems. + * Improve documentation: + + Fix doctests' compatibility with Python 3.6. + + Don't require TeX distribution to render math formulas. + + Simplify some module docstrings. + + Fix typos in docstrings. + + Update bug tracker URLs. + The project repo has moved to GitHub. + * Improve the setup script: + + Check Cython version. + + Use “python -m cython” instead of the “cython” script. + + Report build-time requirements to pip. + + Don't use setuptools, except on Windows. + + Remove poorly standardized “platforms” metadata key. (The information + about supported platform is available in the “Operating System” + classifiers.) + + Add the “Programming Language :: Cython” classifier. + * Don't hardcode the Python interpreter path in script shebangs; use + “#!/usr/bin/env python” instead. + + -- Jakub Wilk <[email protected]> Fri, 05 Aug 2016 22:52:25 +0200 + python-djvulibre (0.7.2) unstable; urgency=low * Fix compatibility with Cython 0.24. @@ -80,7 +108,7 @@ * Exclude djvu/config.pxi from the source tarball. Thanks to Daniel Stender for the bug report. - https://bitbucket.org/jwilk/python-djvulibre/issues/4 + https://github.com/jwilk/python-djvulibre/issues/4 -- Jakub Wilk <[email protected]> Mon, 27 Jul 2015 10:28:21 +0200 @@ -117,7 +145,7 @@ + Fix test_bad_io failures with Cython ≥ 0.21. * Improve setup.py: + Make it possible to build the package natively on Windows. - https://bitbucket.org/jwilk/python-djvulibre/issue/1 + https://github.com/jwilk/python-djvulibre/issues/1 * Use HTTPS URLs when they are available, in documentation and code. -- Jakub Wilk <[email protected]> Tue, 04 Nov 2014 11:44:09 +0100 @@ -241,7 +269,7 @@ * Allow rendering images directly into a writable buffer (e.g. an array), rather than to a newly created string. That should ease integration of - python-djulibre with e.g. numpy or cairo. + python-djvulibre with e.g. numpy or cairo. * Add two simple example programs. -- Jakub Wilk <[email protected]> Thu, 11 Feb 2010 17:48:36 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/examples/djvu-crop-text new/python-djvulibre-0.8/examples/djvu-crop-text --- old/python-djvulibre-0.7.2/examples/djvu-crop-text 2015-09-04 23:57:59.000000000 +0200 +++ new/python-djvulibre-0.8/examples/djvu-crop-text 2016-07-27 13:02:44.000000000 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # encoding=UTF-8 # Copyright © 2008-2015 Jakub Wilk <[email protected]> @@ -84,7 +84,7 @@ text = EMPTY_TEXT_SEXPR return text - def process(self, path, pages = None): + def process(self, path, pages=None): print('Processing {path!r}:'.format(path=path), file=sys.stderr) document = self.new_document(djvu.decode.FileURI(path)) document.decoding_job.wait() @@ -92,7 +92,7 @@ if pages is None: pages = iter(document.pages) else: - pages = (document.pages[i-1] for i in pages) + pages = (document.pages[i - 1] for i in pages) sed_file.write('remove-txt\n') for page in pages: sed_file.write('select {0}\n'.format(page.n + 1)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/examples/djvu-dump-text new/python-djvulibre-0.8/examples/djvu-dump-text --- old/python-djvulibre-0.7.2/examples/djvu-dump-text 2015-09-04 23:58:27.000000000 +0200 +++ new/python-djvulibre-0.8/examples/djvu-dump-text 2016-07-15 11:06:49.000000000 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # encoding=UTF-8 # Copyright © 2008-2015 Jakub Wilk <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/examples/djvu2png new/python-djvulibre-0.8/examples/djvu2png --- old/python-djvulibre-0.7.2/examples/djvu2png 2015-08-18 10:36:08.000000000 +0200 +++ new/python-djvulibre-0.8/examples/djvu2png 2016-07-15 11:06:52.000000000 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # encoding=UTF-8 # Copyright © 2010-2015 Jakub Wilk <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/private/mingw32-setup-env new/python-djvulibre-0.8/private/mingw32-setup-env --- old/python-djvulibre-0.7.2/private/mingw32-setup-env 2016-02-20 13:38:11.000000000 +0100 +++ new/python-djvulibre-0.8/private/mingw32-setup-env 1970-01-01 01:00:00.000000000 +0100 @@ -1,71 +0,0 @@ -#!/bin/sh - -# Copyright © 2010-2016 Jakub Wilk <[email protected]> -# -# This file is part of python-djvulibre. -# -# python-djvulibre is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# python-djvulibre is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. - -if [ $# -ne 1 ] -then - printf 'Usage: %s <target>\n\n<target> is e.g. i686-w64-mingw32\n\n' "$0" - exit 1 -fi - -set -e -x - -target="$1" -pwd=$(pwd) -mkdir -p "$target/common/" -tmpdir=$(mktemp -d -t python-djvulibre.mingw32.XXXXXX) || exit 1 -cd "$tmpdir" -wget -i - <<EOF -https://downloads.sourceforge.net/project/djvu/DjVuLibre_Windows/3.5.23%2B4.6/DjVuLibre%2BDjView-3.5.23b%2B4.6-Setup.exe -https://www.python.org/ftp/python/2.6.6/python-2.6.6.msi -https://www.python.org/ftp/python/2.7.1/python-2.7.1.msi -https://www.python.org/ftp/python/3.1.2/python-3.1.2.msi -https://www.python.org/ftp/python/3.2/python-3.2.msi -EOF -sha256sum -c - << EOF -3b986a2fbb1c35a91750ae0d29232c111a52883bd99eb14d20805bc9f5592203 DjVuLibre+DjView-3.5.23b+4.6-Setup.exe -1192931440475d07fb3e9724531a53de34097ad24e519bff2e5f458c375a31b3 python-2.6.6.msi -0af8bc05a5f9ed15df120150c6a6ddd0fc50d018e35b891cba22040e0404dfb6 python-2.7.1.msi -ca802f144a7e8268a773fa2567fecb0a1d792c62c00f751f27d103a263352113 python-3.1.2.msi -3132305f1b19905178be0f76206ebeeebbf35e5ccef367f6f22cd32aef1d6e56 python-3.2.msi -EOF -WINEPREFIX="$tmpdir" wine DjVuLibre*exe /S -for version in 2.6 2.7 3.1 3.2 -do - mkdir -p "$pwd/$target/python$version/" - cabextract -d "$pwd/$target/python$version/" -F '*.h' python-$version*.msi - cabextract -d "$pwd/$target/python$version/" -F 'python*.dll' python-$version*.msi - for file in msvcr90.dll libmsvcr.a libdjvulibre.dll libjpeg.dll libdjvu - do - ln -sf "../common/$file" "$pwd/$target/python$version/$file" - done -done -cabextract -d "$pwd/$target/common/" -F 'msvcr90.dll' python-2.6*.msi -cat > msvcr.def <<EOF -EXPORTS -__dllonexit -_assert -_errno -fflush -free -malloc -EOF -"$target-dlltool" --kill-at --def msvcr.def --dllname msvcr90.dll --output-lib "$pwd/$target/common/libmsvcr.a" -cd 'drive_c/Program Files/DjVuZone/DjVuLibre/' -cp -v libdjvulibre.dll libjpeg.dll "$pwd/$target/common/" -cp -vr include/libdjvu "$pwd/$target/common/" -cd / -rm -Rf "$tmpdir" - -# vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/python_djvulibre.egg-info/PKG-INFO new/python-djvulibre-0.8/python_djvulibre.egg-info/PKG-INFO --- old/python-djvulibre-0.7.2/python_djvulibre.egg-info/PKG-INFO 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/python_djvulibre.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -Metadata-Version: 1.1 -Name: python-djvulibre -Version: 0.7.2 -Summary: Python support for the DjVu image format -Home-page: http://jwilk.net/software/python-djvulibre -Author: Jakub Wilk -Author-email: [email protected] -License: GNU GPL 2 -Description: *python-djvulibre* is a set of Python bindings for - the `DjVuLibre <http://djvu.sourceforge.net/>`_ library, - an open source implementation of `DjVu <http://djvu.org/>`_. -Platform: all -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: GNU General Public License (GPL) -Classifier: Operating System :: POSIX -Classifier: Operating System :: Microsoft :: Windows :: Windows 95/98/2000 -Classifier: Operating System :: Microsoft :: Windows :: Windows NT/2000 -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 3 -Classifier: Topic :: Multimedia :: Graphics -Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion -Classifier: Topic :: Text Processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/python_djvulibre.egg-info/SOURCES.txt new/python-djvulibre-0.8/python_djvulibre.egg-info/SOURCES.txt --- old/python-djvulibre-0.7.2/python_djvulibre.egg-info/SOURCES.txt 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/python_djvulibre.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,47 +0,0 @@ -MANIFEST.in -setup.py -djvu/__init__.py -djvu/common.pxi -djvu/const.py -djvu/decode.pxd -djvu/decode.pyx -djvu/dllpath.py -djvu/sexpr.pxd -djvu/sexpr.pyx -doc/COPYING -doc/build-reqs.txt -doc/changelog -doc/credits.txt -doc/todo.txt -doc/api/annotations.rst -doc/api/conf.py -doc/api/documents.rst -doc/api/event-model.rst -doc/api/exceptions.rst -doc/api/expressions.rst -doc/api/files.rst -doc/api/geometry.rst -doc/api/index.rst -doc/api/messages.rst -doc/api/outline.rst -doc/api/pages.rst -doc/api/text-zones.rst -examples/djvu-crop-text -examples/djvu-dump-text -examples/djvu2png -private/apt-install-build-reqs -private/build-and-test -private/mingw32-setup-env -python_djvulibre.egg-info/PKG-INFO -python_djvulibre.egg-info/SOURCES.txt -python_djvulibre.egg-info/dependency_links.txt -python_djvulibre.egg-info/top_level.txt -tests/sexpr-gc.py -tests/test_const.py -tests/test_decode.py -tests/test_sexpr.py -tests/tools.py -tests/images/Makefile -tests/images/test0.djvu -tests/images/test0.tex -tests/images/test1.djvu \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/python_djvulibre.egg-info/dependency_links.txt new/python-djvulibre-0.8/python_djvulibre.egg-info/dependency_links.txt --- old/python-djvulibre-0.7.2/python_djvulibre.egg-info/dependency_links.txt 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/python_djvulibre.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/python_djvulibre.egg-info/top_level.txt new/python-djvulibre-0.8/python_djvulibre.egg-info/top_level.txt --- old/python-djvulibre-0.7.2/python_djvulibre.egg-info/top_level.txt 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/python_djvulibre.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -djvu diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/setup.cfg new/python-djvulibre-0.8/setup.cfg --- old/python-djvulibre-0.7.2/setup.cfg 2016-05-12 14:18:58.000000000 +0200 +++ new/python-djvulibre-0.8/setup.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/setup.py new/python-djvulibre-0.8/setup.py --- old/python-djvulibre-0.7.2/setup.py 2016-05-12 10:51:20.000000000 +0200 +++ new/python-djvulibre-0.8/setup.py 2016-08-03 19:57:43.000000000 +0200 @@ -1,6 +1,6 @@ # encoding=UTF-8 -# Copyright © 2007-2015 Jakub Wilk <[email protected]> +# Copyright © 2007-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -24,8 +24,8 @@ Intended Audience :: Developers License :: OSI Approved :: GNU General Public License (GPL) Operating System :: POSIX -Operating System :: Microsoft :: Windows :: Windows 95/98/2000 -Operating System :: Microsoft :: Windows :: Windows NT/2000 +Operating System :: Microsoft :: Windows +Programming Language :: Cython Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 3 @@ -36,30 +36,20 @@ import glob import os -import sys import subprocess as ipc +import re +import sys -if os.name == 'posix' and os.getenv('python_djvulibre_mingw32'): - import mingw32cross -else: - mingw32cross = None - +need_setuptools = False if os.name == 'nt': import djvu.dllpath + need_setuptools = True -# Just to make sure setuptools won't try to be clever: -fake_module = type(sys)('fake_module') -fake_module.build_ext = None -sys.modules['Pyrex'] = sys.modules['Pyrex.Distutils'] = sys.modules['Pyrex.Distutils.build_ext'] = fake_module -del fake_module - -try: - import setuptools as distutils_core +if need_setuptools: import setuptools.extension assert setuptools.extension.have_pyrex -except ImportError: - import distutils.core as distutils_core -import distutils + +import distutils.core import distutils.ccompiler import distutils.command.build_ext import distutils.dep_util @@ -80,18 +70,17 @@ yield module ext_modules = list(ext_modules()) -def get_version(): - open_opts = {} +def uopen(path): if str != bytes: - open_opts.update(encoding='UTF-8') - changelog = open( - os.path.join(os.path.dirname(__file__), 'doc', 'changelog'), - **open_opts - ) - try: - return changelog.readline().split()[1].strip('()') - finally: - changelog.close() + return open(path, 'rt', encoding='UTF-8') + else: + return open(path, 'rt') + +def get_version(): + path = os.path.join(os.path.dirname(__file__), 'doc', 'changelog') + with uopen(path) as file: + line = file.readline() + return line.split()[1].strip('()') def run_pkgconfig(*cmdline): cmdline = ['pkg-config'] + list(cmdline) @@ -100,9 +89,8 @@ cmdline, stdout=ipc.PIPE, stderr=ipc.PIPE ) - except EnvironmentError: - _, exc, _ = sys.exc_info() - msg = 'cannot execute pkg-config: {exc}'.format(exc=exc) + except EnvironmentError as exc: + msg = 'cannot execute pkg-config: {exc.strerror}'.format(exc=exc) distutils.log.warn(msg) return stdout, stderr = pkgconfig.communicate() @@ -127,8 +115,9 @@ dll_path = djvu.dllpath.guess_dll_path() if dll_path is not None: fallback.update( - extra_compile_args=['-I' + os.path.join(dll_path, 'include')], - extra_link_args=['-L' + os.path.join(dll_path)], + include_dirs=[os.path.join(dll_path, 'include')], + library_dirs=[os.path.join(dll_path)], + libraries=['libdjvulibre'], ) stdout = run_pkgconfig('--libs', '--cflags', *packages) if stdout is None: @@ -146,17 +135,42 @@ return kwargs def pkgconfig_version(package): - V = distutils.version.LooseVersion stdout = run_pkgconfig('--modversion', package) if stdout is None: + return + return stdout.strip() + +def get_djvulibre_version(): + version = pkgconfig_version('ddjvuapi') + if version is None: if os.name == 'posix': raise RuntimeError('cannot determine DjVuLibre version') - return V('0') - version = stdout.strip() - return V(version) + elif os.name == 'nt': + version = djvu.dllpath._guess_dll_version() + version = version or '0' + return distutils.version.LooseVersion(version) + +def get_cython_version(): + cmdline = ['python', '-m', 'cython', '--version'] + cmd = ipc.Popen(cmdline, stdout=ipc.PIPE, stderr=ipc.STDOUT) + stdout, stderr = cmd.communicate() + if not isinstance(stdout, str): + stdout = stdout.decode('ASCII') + match = re.match(r'\ACython version (\d\S+)', stdout) + if match: + ver = match.group(1) + else: + ver = '0' + return distutils.version.LooseVersion(ver) -djvulibre_version = pkgconfig_version('ddjvuapi') py_version = get_version() +cython_version = get_cython_version() +if str != bytes: + # Python 3.X + req_cython_version = '0.20' +else: + # Python 2.X + req_cython_version = '0.19' # Work-around for <https://bugs.python.org/issue969718>: os.environ.pop('CFLAGS', None) @@ -164,13 +178,15 @@ class build_ext(distutils.command.build_ext.build_ext): 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') new_config = [ 'DEF PY3K = {0}'.format(sys.version_info >= (3, 0)), 'DEF PYTHON_DJVULIBRE_VERSION = b"{0}"'.format(py_version), 'DEF HAVE_MINIEXP_IO_T = {0}'.format(djvulibre_version >= '3.5.26'), - 'DEF HAVE_LANGINFO_H = {0}'.format(os.name == 'posix' and not mingw32cross), + 'DEF HAVE_LANGINFO_H = {0}'.format(os.name == 'posix'), + 'DEF WINDOWS = {0}'.format(os.name == 'nt'), ] self.src_dir = src_dir = os.path.join(self.build_temp, 'src') distutils.dir_util.mkpath(src_dir) @@ -206,8 +222,10 @@ continue 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)) distutils.spawn.spawn([ - 'cython', + 'python', '-m', 'cython', '-I', os.path.dirname(self.config_path), '-o', target, source, @@ -235,7 +253,7 @@ compiler_flags = pkgconfig_build_flags('ddjvuapi') -setup_params = dict( +meta = dict( name='python-djvulibre', version=py_version, author='Jakub Wilk', @@ -245,7 +263,9 @@ long_description=__doc__.strip(), classifiers=classifiers, url='http://jwilk.net/software/python-djvulibre', - platforms=['all'], +) + +setup_params = dict( packages=['djvu'], ext_modules=[ distutils.command.build_ext.Extension( @@ -261,10 +281,22 @@ (cmd.__name__, cmd) for cmd in (build_ext, build_sphinx) if cmd is not None - ) + ), + **meta ) if __name__ == '__main__': - distutils_core.setup(**setup_params) + if 'setuptools' in sys.modules and sys.argv[1] == 'egg_info': + # We wouldn't normally want setuptools; but pip forces it upon us anyway, + # so let's abuse it to instruct pip to install Cython if it's missing. + distutils.core.setup( + install_requires=['Cython>={ver}'.format(ver=req_cython_version)], + # Conceptually, “setup_requires” would make more sense than + # “install_requires”, but the former is not supported by pip: + # https://github.com/pypa/pip/issues/1820 + **meta + ) + else: + distutils.core.setup(**setup_params) # vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/tests/test_decode.py new/python-djvulibre-0.8/tests/test_decode.py --- old/python-djvulibre-0.7.2/tests/test_decode.py 2016-02-20 13:14:01.000000000 +0100 +++ new/python-djvulibre-0.8/tests/test_decode.py 2016-08-02 12:52:42.000000000 +0200 @@ -109,18 +109,16 @@ def run(*cmd, **kwargs): stdin = kwargs.pop('stdin', None) - env = {} + env = dict(os.environ) for key, value in kwargs.items(): if key.isupper(): env[key] = value continue raise TypeError('{key!r} is an invalid keyword argument for this function'.format(key=key)) - def preexec_fn(): - os.environ.update(env) kwargs = dict( - preexec_fn=preexec_fn, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + env=env, ) if stdin is not None: kwargs.update(stdin=subprocess.PIPE) @@ -172,8 +170,7 @@ path = '__nonexistent__' try: os.stat(path) - except OSError: - _, ex, _ = sys.exc_info() + except OSError as ex: c_message = ex.args[1] else: raise OSError(errno.EEXIST, os.strerror(errno.EEXIST), path) @@ -200,8 +197,7 @@ try: with interim_locale(LC_ALL='ja_JP.UTF-8'): os.stat(path) - except OSError: - _, ex, _ = sys.exc_info() + except OSError as ex: c_message = ex.args[1] else: raise OSError(errno.EEXIST, os.strerror(errno.EEXIST), path) @@ -537,7 +533,7 @@ page_job.render(RENDER_COLOR, (0, 0, 10, 10), (0, 0, 10, 10), PixelFormatRgb(), -1) with assert_raises_regex(MemoryError, r'\AUnable to allocate [0-9]+ bytes for an image memory\Z'): - x = int((maxsize//2) ** 0.5) + x = int((maxsize // 2) ** 0.5) page_job.render(RENDER_COLOR, (0, 0, x, x), (0, 0, x, x), PixelFormatRgb(), 8) s = page_job.render(RENDER_COLOR, (0, 0, 10, 10), (0, 0, 4, 4), PixelFormatGrey(), 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/tests/test_sexpr.py new/python-djvulibre-0.8/tests/test_sexpr.py --- old/python-djvulibre-0.7.2/tests/test_sexpr.py 2015-08-23 11:24:21.000000000 +0200 +++ new/python-djvulibre-0.8/tests/test_sexpr.py 2016-08-01 22:44:09.000000000 +0200 @@ -1,6 +1,6 @@ # encoding=UTF-8 -# Copyright © 2007-2015 Jakub Wilk <[email protected]> +# Copyright © 2007-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -13,11 +13,14 @@ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. -import collections import codecs +import collections import copy import errno import io +import os +import shutil +import sys import tempfile import pickle @@ -537,10 +540,20 @@ Expression.from_stream(42) def test_bad_file_io(self): + if os.name == 'nt': + raise SkipTest('not implemented on Windows') + path = '/proc/self/mem' + try: + os.stat(path) + except OSError as exc: + raise SkipTest('{exc.filename}: {exc.strerror}'.format(exc=exc)) with open('/proc/self/mem') as fp: with assert_raises(IOError) as ecm: Expression.from_stream(fp) - assert_equal(ecm.exception.errno, errno.EIO) + assert_in( + ecm.exception.errno, + (errno.EIO, errno.EFAULT) + ) if py3k: def test_bad_unicode_io(self): @@ -583,11 +596,15 @@ self.t(fp) def test_codecs_io(self): - with tempfile.NamedTemporaryFile(mode='w+b') as bfp: - with codecs.open(bfp.name, mode='w+', encoding='UTF-16-LE') as fp: + tmpdir = tempfile.mkdtemp() + try: + path = os.path.join(tmpdir, 'tmp') + with codecs.open(path, mode='w+', encoding='UTF-16-LE') as fp: fp.write(u(self.expr)) fp.seek(0) self.t(fp) + finally: + shutil.rmtree(tmpdir) def test_file_io_binary(self): with tempfile.TemporaryFile(mode='w+b') as fp: @@ -612,7 +629,12 @@ def test_bad_file_io(self): ecm = None - fp = open('/dev/full', 'w', buffering=2) + path = '/dev/full' + try: + os.stat(path) + except OSError as exc: + raise SkipTest('{exc.filename}: {exc.strerror}'.format(exc=exc)) + fp = open(path, 'w', buffering=2) expr = Expression(23) try: with assert_raises(IOError) as ecm: @@ -685,18 +707,26 @@ assert_equal(fp.read(), self.urepr) def test_codecs_io_text_7(self): - with tempfile.NamedTemporaryFile(mode='w+b') as bfp: - with codecs.open(bfp.name, mode='w+', encoding='UTF-16-LE') as fp: + tmpdir = tempfile.mkdtemp() + try: + path = os.path.join(tmpdir, 'tmp') + with codecs.open(path, mode='w+', encoding='UTF-16-LE') as fp: self.expr.print_into(fp) fp.seek(0) assert_equal(fp.read(), self.repr) + finally: + shutil.rmtree(tmpdir) def test_codecs_io_text_8(self): - with tempfile.NamedTemporaryFile(mode='w+b') as bfp: - with codecs.open(bfp.name, mode='w+', encoding='UTF-16-LE') as fp: + tmpdir = tempfile.mkdtemp() + try: + path = os.path.join(tmpdir, 'tmp') + with codecs.open(path, mode='w+', encoding='UTF-16-LE') as fp: self.expr.print_into(fp, escape_unicode=False) fp.seek(0) assert_equal(fp.read(), u(self.urepr)) + finally: + shutil.rmtree(tmpdir) def test_file_io_binary_7(self): with tempfile.TemporaryFile(mode='w+b') as fp: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-djvulibre-0.7.2/tests/tools.py new/python-djvulibre-0.8/tests/tools.py --- old/python-djvulibre-0.7.2/tests/tools.py 2016-02-20 12:54:37.000000000 +0100 +++ new/python-djvulibre-0.8/tests/tools.py 2016-08-05 22:52:11.000000000 +0200 @@ -1,6 +1,6 @@ # encoding=UTF-8 -# Copyright © 2010-2015 Jakub Wilk <[email protected]> +# Copyright © 2010-2016 Jakub Wilk <[email protected]> # # This file is part of python-djvulibre. # @@ -15,6 +15,7 @@ import codecs import contextlib +import distutils.spawn import locale import os import re @@ -210,8 +211,7 @@ category = getattr(locale, category) try: locale.setlocale(category, value) - except locale.Error: - _, exc, _ = sys.exc_info() + except locale.Error as exc: raise SkipTest(exc) yield finally: @@ -233,8 +233,7 @@ with interim_locale(LC_ALL=lang): try: open(__file__ + '/') - except EnvironmentError: - _, exc, _ = sys.exc_info() + except EnvironmentError as exc: messages[lang] = str(exc) messages = set(messages.values()) assert 1 <= len(messages) <= 2 @@ -242,11 +241,8 @@ raise SkipTest('libc translation not found: ' + lang) def skip_unless_command_exists(command): - directories = os.environ['PATH'].split(os.pathsep) - for directory in directories: - path = os.path.join(directory, command) - if os.access(path, os.X_OK): - return + if distutils.spawn.find_executable(command): + return raise SkipTest('command not found: ' + command) def wildcard_import(mod):
