Hello community,

here is the log from the commit of package python-tesserocr for 
openSUSE:Factory checked in at 2018-07-01 21:26:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tesserocr (Old)
 and      /work/SRC/openSUSE:Factory/.python-tesserocr.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tesserocr"

Sun Jul  1 21:26:30 2018 rev:2 rq:619191 version:2.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tesserocr/python-tesserocr.changes        
2017-08-30 16:24:19.775982859 +0200
+++ /work/SRC/openSUSE:Factory/.python-tesserocr.new/python-tesserocr.changes   
2018-07-01 21:26:30.612759628 +0200
@@ -1,0 +2,14 @@
+Tue Jun 26 16:07:43 UTC 2018 - [email protected]
+
+- Run tests
+- Use %license macro
+- Update to version 2.3.0
+  * Support for Tesseract 4
+    + New OCR engines LSTM_ONLY and TESSERACT_LSTM_COMBINED
+    + New default tessdata path handling
+  * Fixed compilation against Tesseract v3.05.02 which required
+    c++11
+  * Fallback to 'eng' as default language when default language
+    returned by the API is empty
+
+-------------------------------------------------------------------

Old:
----
  _service
  tesserocr-2.2.2.tar.gz

New:
----
  tesserocr-2.3.0.tar.gz

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

Other differences:
------------------
++++++ python-tesserocr.spec ++++++
--- /var/tmp/diff_new_pack.6q7dfM/_old  2018-07-01 21:26:31.188758879 +0200
+++ /var/tmp/diff_new_pack.6q7dfM/_new  2018-07-01 21:26:31.192758874 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tesserocr
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without test
 Name:           python-tesserocr
-Version:        2.2.2
+Version:        2.3.0
 Release:        0
 Summary:        A simple, Pillow-friendly, Python wrapper around tesseract-ocr
 License:        MIT
@@ -27,12 +27,16 @@
 Url:            https://github.com/sirfz/tesserocr
 Source:         
https://files.pythonhosted.org/packages/source/t/tesserocr/tesserocr-%{version}.tar.gz
 BuildRequires:  %{python_module Cython}
-BuildRequires:  %{python_module six}
+BuildRequires:  %{python_module Pillow}
 BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module six}
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig
 BuildRequires:  python-rpm-macros
+BuildRequires:  tesseract-ocr-traineddata-english
+BuildRequires:  tesseract-ocr-traineddata-orientation_and_script_detection
 BuildRequires:  pkgconfig(tesseract)
 Recommends:     python-Pillow
 %python_subpackages
@@ -55,9 +59,13 @@
 %install
 %python_install
 
+%check
+%python_exec setup.py develop --user
+%python_exec -m pytest -v tests
+
 %files %{python_files}
-%defattr(-,root,root,-)
-%doc LICENSE README.rst
+%license LICENSE
+%doc README.rst
 %{python_sitearch}/*
 
 %changelog

++++++ tesserocr-2.2.2.tar.gz -> tesserocr-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/PKG-INFO new/tesserocr-2.3.0/PKG-INFO
--- old/tesserocr-2.2.2/PKG-INFO        2017-07-26 20:53:03.000000000 +0200
+++ new/tesserocr-2.3.0/PKG-INFO        2018-06-26 17:40:17.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tesserocr
-Version: 2.2.2
+Version: 2.3.0
 Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API 
using Cython
 Home-page: https://github.com/sirfz/tesserocr
 Author: Fayez Zouheiry
@@ -59,7 +59,8 @@
         
         Installation
         ============
-        
+        Linux and BSD/MacOS
+        -------------------
         ::
         
             $ pip install tesserocr
@@ -82,6 +83,26 @@
         .. |pkg-config| replace:: **pkg-config**
         .. _pkg-config: https://pkgconfig.freedesktop.org/
         
+        Windows
+        -------
+        The proposed downloads consist of stand-alone packages containing all 
the Windows libraries needed for execution. This means that no additional 
installation of tesseract is required on your system.
+        
+        Conda
+        `````
+        You can use the channel `simonflueckiger 
<https://anaconda.org/simonflueckiger/tesserocr>`_ to install from Conda:
+        ::
+            > conda install -c simonflueckiger tesserocr
+        
+        or to get **tesserocr** compiled with **tesseract 4.0.0**:
+        ::
+            > conda install -c simonflueckiger/label/tesseract-4.0.0-master 
tesserocr
+        
+        pip
+        ```
+        Download the wheel file corresponding to your Windows platform and 
Python installation from `simonflueckiger/tesserocr-windows_build/releases 
<https://github.com/simonflueckiger/tesserocr-windows_build/releases>`_ and 
install them via:
+        ::
+            > pip install <package_name>.whl
+        
         Usage
         =====
         
@@ -236,7 +257,6 @@
 Classifier: Operating System :: POSIX
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/README.rst 
new/tesserocr-2.3.0/README.rst
--- old/tesserocr-2.2.2/README.rst      2017-05-28 16:31:28.000000000 +0200
+++ new/tesserocr-2.3.0/README.rst      2018-04-09 15:20:26.000000000 +0200
@@ -51,7 +51,8 @@
 
 Installation
 ============
-
+Linux and BSD/MacOS
+-------------------
 ::
 
     $ pip install tesserocr
@@ -74,6 +75,26 @@
 .. |pkg-config| replace:: **pkg-config**
 .. _pkg-config: https://pkgconfig.freedesktop.org/
 
+Windows
+-------
+The proposed downloads consist of stand-alone packages containing all the 
Windows libraries needed for execution. This means that no additional 
installation of tesseract is required on your system.
+
+Conda
+`````
+You can use the channel `simonflueckiger 
<https://anaconda.org/simonflueckiger/tesserocr>`_ to install from Conda:
+::
+    > conda install -c simonflueckiger tesserocr
+
+or to get **tesserocr** compiled with **tesseract 4.0.0**:
+::
+    > conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr
+
+pip
+```
+Download the wheel file corresponding to your Windows platform and Python 
installation from `simonflueckiger/tesserocr-windows_build/releases 
<https://github.com/simonflueckiger/tesserocr-windows_build/releases>`_ and 
install them via:
+::
+    > pip install <package_name>.whl
+
 Usage
 =====
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/setup.py new/tesserocr-2.3.0/setup.py
--- old/tesserocr-2.2.2/setup.py        2017-07-26 20:25:09.000000000 +0200
+++ new/tesserocr-2.3.0/setup.py        2018-06-26 17:06:31.000000000 +0200
@@ -49,7 +49,12 @@
 
 def version_to_int(version):
     version = re.search(r'((?:\d+\.)+\d+)', version).group()
-    return int(''.join(version.split('.')), 16)
+    # Split the groups on ".", take only the first one, and print each group 
with leading 0 if needed
+    # To be safe, also handle cases where an extra group is added to the 
version string, or if one or two groups
+    # are dropped.
+    version_groups = (version.split('.') + [0, 0])[:3]
+    version_str = "{:02}{:02}{:02}".format(*map(int, version_groups))
+    return int(version_str, 16)
 
 
 def package_config():
@@ -127,9 +132,9 @@
             _LOGGER.warn('pkg-config failed to find tesseract/lept libraries: 
{}'.format(e))
         build_args = get_tesseract_version()
 
-    if build_args['cython_compile_time_env']['TESSERACT_VERSION'] >= 0x040000:
-        _LOGGER.debug('tesseract >= 4.00 requires c++11 compiler support')
-        build_args['extra_compile_args'] = ['-std=c++11']
+    if build_args['cython_compile_time_env']['TESSERACT_VERSION'] >= 0x030502:
+        _LOGGER.debug('tesseract >= 03.05.02 requires c++11 compiler support')
+        build_args['extra_compile_args'] = ['-std=c++11', 
'-DUSE_STD_NAMESPACE']
 
     _LOGGER.debug('build parameters: {}'.format(build_args))
     return build_args
@@ -168,7 +173,6 @@
           'Operating System :: POSIX',
           'Programming Language :: Python :: 2.7',
           'Programming Language :: Python :: 3',
-          'Programming Language :: Python :: 3.2',
           'Programming Language :: Python :: 3.3',
           'Programming Language :: Python :: 3.4',
           'Programming Language :: Python :: 3.5',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/tesseract.pxd 
new/tesserocr-2.3.0/tesseract.pxd
--- old/tesserocr-2.2.2/tesseract.pxd   2017-06-18 23:26:40.000000000 +0200
+++ new/tesserocr-2.3.0/tesseract.pxd   2018-02-04 20:28:35.000000000 +0100
@@ -219,8 +219,6 @@
             OEM_LSTM_ONLY
             OEM_TESSERACT_LSTM_COMBINED
             OEM_DEFAULT
-            OEM_CUBE_ONLY
-            OEM_TESSERACT_CUBE_COMBINED
     ELSE:
         cdef enum OcrEngineMode:
             OEM_TESSERACT_ONLY
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/tesserocr.egg-info/PKG-INFO 
new/tesserocr-2.3.0/tesserocr.egg-info/PKG-INFO
--- old/tesserocr-2.2.2/tesserocr.egg-info/PKG-INFO     2017-07-26 
20:53:03.000000000 +0200
+++ new/tesserocr-2.3.0/tesserocr.egg-info/PKG-INFO     2018-06-26 
17:40:17.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tesserocr
-Version: 2.2.2
+Version: 2.3.0
 Summary: A simple, Pillow-friendly, Python wrapper around tesseract-ocr API 
using Cython
 Home-page: https://github.com/sirfz/tesserocr
 Author: Fayez Zouheiry
@@ -59,7 +59,8 @@
         
         Installation
         ============
-        
+        Linux and BSD/MacOS
+        -------------------
         ::
         
             $ pip install tesserocr
@@ -82,6 +83,26 @@
         .. |pkg-config| replace:: **pkg-config**
         .. _pkg-config: https://pkgconfig.freedesktop.org/
         
+        Windows
+        -------
+        The proposed downloads consist of stand-alone packages containing all 
the Windows libraries needed for execution. This means that no additional 
installation of tesseract is required on your system.
+        
+        Conda
+        `````
+        You can use the channel `simonflueckiger 
<https://anaconda.org/simonflueckiger/tesserocr>`_ to install from Conda:
+        ::
+            > conda install -c simonflueckiger tesserocr
+        
+        or to get **tesserocr** compiled with **tesseract 4.0.0**:
+        ::
+            > conda install -c simonflueckiger/label/tesseract-4.0.0-master 
tesserocr
+        
+        pip
+        ```
+        Download the wheel file corresponding to your Windows platform and 
Python installation from `simonflueckiger/tesserocr-windows_build/releases 
<https://github.com/simonflueckiger/tesserocr-windows_build/releases>`_ and 
install them via:
+        ::
+            > pip install <package_name>.whl
+        
         Usage
         =====
         
@@ -236,7 +257,6 @@
 Classifier: Operating System :: POSIX
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/tesserocr.pyx 
new/tesserocr-2.3.0/tesserocr.pyx
--- old/tesserocr-2.2.2/tesserocr.pyx   2017-07-26 20:34:00.000000000 +0200
+++ new/tesserocr-2.3.0/tesserocr.pyx   2018-06-26 17:07:15.000000000 +0200
@@ -18,7 +18,7 @@
  ['eng', 'osd', 'equ'])
 """
 
-__version__ = '2.2.2'
+__version__ = '2.3.0'
 
 import os
 from io import BytesIO
@@ -48,8 +48,14 @@
 cdef TessBaseAPI _api = TessBaseAPI()
 _api.SetVariable('debug_file', '/dev/null')  # suppress tesseract debug 
messages
 _api.Init(NULL, NULL)
-cdef _DEFAULT_PATH = abspath(join(_api.GetDatapath(), os.pardir)) + os.sep
-cdef _DEFAULT_LANG = _api.GetInitLanguagesAsString()
+IF TESSERACT_VERSION >= 0x040000:
+    cdef _DEFAULT_PATH = _api.GetDatapath()  # "tessdata/" is not appended by 
tesseract since commit dba13db
+ELSE:
+    cdef _DEFAULT_PATH = abspath(join(_api.GetDatapath(), os.pardir)) + os.sep
+_init_lang = _api.GetInitLanguagesAsString()
+if _init_lang == '':
+    _init_lang = 'eng'
+cdef _DEFAULT_LANG = _init_lang
 _api.End()
 TessBaseAPI.ClearPersistentCache()
 
@@ -81,8 +87,9 @@
     IF TESSERACT_VERSION >= 0x040000:
         LSTM_ONLY = OEM_LSTM_ONLY
         TESSERACT_LSTM_COMBINED = OEM_TESSERACT_LSTM_COMBINED
-    CUBE_ONLY = OEM_CUBE_ONLY
-    TESSERACT_CUBE_COMBINED = OEM_TESSERACT_CUBE_COMBINED
+    ELSE:
+        CUBE_ONLY = OEM_CUBE_ONLY
+        TESSERACT_CUBE_COMBINED = OEM_TESSERACT_CUBE_COMBINED
     DEFAULT = OEM_DEFAULT
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tesserocr-2.2.2/tests/test_api.py 
new/tesserocr-2.3.0/tests/test_api.py
--- old/tesserocr-2.2.2/tests/test_api.py       2017-06-20 18:08:20.000000000 
+0200
+++ new/tesserocr-2.3.0/tests/test_api.py       2018-06-26 17:01:22.000000000 
+0200
@@ -11,7 +11,11 @@
 
 def version_to_int(version):
     version = re.search(r'((?:\d+\.)+\d+)', version).group()
-    return int(''.join(version.split('.')), 16)
+    # Split the groups on ".", take only the first one, and print each group 
with leading 0 if needed
+    # To be safe, also handle cases where an extra group is added to the 
version string, or if one or two groups
+    # are dropped.
+    version_str = "{:02}{:02}{:02}".format(*map(int, (version.split('.') + 
[0]*2)[:3]))
+    return int(version_str, 16)
 
 
 class TestTessBaseApi(unittest.TestCase):
@@ -108,7 +112,10 @@
         path = self._api.GetDatapath()
         self._api.End()
         self.assertRaises(RuntimeError, self._api.Init, path=(self._test_dir + 
os.path.sep))  # no tessdata
-        new_path = os.path.abspath(os.path.join(path, os.path.pardir)) + 
os.path.sep
+        if self._tesseract_version >= 0x040000:
+            new_path = path
+        else:
+            new_path = os.path.abspath(os.path.join(path, os.path.pardir)) + 
os.path.sep
         self._api.End()
         self._api.Init(new_path)
         self.assertEqual(self._api.GetDatapath(), path)


Reply via email to