lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

python3.pkgs.pyocr: 0.7.2 -> 0.8.3

+37 -28
+8 -8
pkgs/development/python-modules/pyocr/default.nix
··· 2 2 , fetchFromGitLab 3 3 , buildPythonPackage 4 4 , pillow 5 - , setuptools-scm 6 - , setuptools-scm-git-archive 7 5 , tesseract 8 6 , cuneiform 9 7 , isPy3k ··· 13 11 14 12 buildPythonPackage rec { 15 13 pname = "pyocr"; 16 - version = "0.7.2"; 14 + version = "0.8.3"; 17 15 disabled = !isPy3k; 18 16 19 17 # Don't fetch from PYPI because it doesn't contain tests. ··· 23 21 owner = "OpenPaperwork"; 24 22 repo = "pyocr"; 25 23 rev = version; 26 - sha256 = "09ab86bmizpv94w3mdvdqkjyyvk1vafw3jqhkiw5xx7p180xn3il"; 24 + sha256 = "sha256-gIn50H9liQcTb7SzoWnBwm5LTvkr+R+5OPvITls1B/w="; 27 25 }; 28 26 29 27 patches = [ ··· 33 31 }) 34 32 ]; 35 33 36 - SETUPTOOLS_SCM_PRETEND_VERSION = version; 37 - 38 - buildInputs = [ setuptools-scm setuptools-scm-git-archive ]; 34 + # see the logic in setup.py 35 + ENABLE_SETUPTOOLS_SCM = "0"; 36 + preConfigure = '' 37 + echo 'version = "${version}"' > src/pyocr/_version.py 38 + ''; 39 39 40 40 propagatedBuildInputs = [ pillow ]; 41 41 ··· 45 45 inherit (src.meta) homepage; 46 46 description = "A Python wrapper for Tesseract and Cuneiform"; 47 47 license = licenses.gpl3Plus; 48 - maintainers = with maintainers; [ ]; 48 + maintainers = with maintainers; [ symphorien ]; 49 49 }; 50 50 }
+29 -20
pkgs/development/python-modules/pyocr/paths.patch
··· 1 + commit c4bac00441363fcaeb074682d8226ca523614ea2 2 + Author: Guillaume Girol <symphorien+git@xlumurb.eu> 3 + Date: Sat Aug 20 17:48:01 2022 +0200 4 + 5 + Fix finding tesseract and cuneiform 6 + 1 7 diff --git a/src/pyocr/cuneiform.py b/src/pyocr/cuneiform.py 2 8 index 2e5b717..35647e2 100644 3 9 --- a/src/pyocr/cuneiform.py ··· 19 25 LANGUAGES_LINE_PREFIX = "Supported languages: " 20 26 LANGUAGES_SPLIT_RE = re.compile("[^a-z]") 21 27 diff --git a/src/pyocr/libtesseract/tesseract_raw.py b/src/pyocr/libtesseract/tesseract_raw.py 22 - index a068e73..9ebea5c 100644 28 + index 2002614..9ebea5c 100644 23 29 --- a/src/pyocr/libtesseract/tesseract_raw.py 24 30 +++ b/src/pyocr/libtesseract/tesseract_raw.py 25 31 @@ -2,7 +2,6 @@ import ctypes ··· 30 36 31 37 from ..error import TesseractError 32 38 33 - @@ -10,48 +9,16 @@ from ..error import TesseractError 39 + @@ -10,51 +9,16 @@ from ..error import TesseractError 34 40 logger = logging.getLogger(__name__) 35 41 36 42 TESSDATA_PREFIX = os.getenv('TESSDATA_PREFIX', None) ··· 57 63 - ) 58 64 - ) 59 65 - else: 60 - - TESSDATA_PREFIX = tessdata 66 + - TESSDATA_PREFIX = os.path.join(tessdata, "tessdata") 61 67 - 62 68 - 63 69 -if sys.platform[:3] == "win": # pragma: no cover ··· 77 83 - ] 78 84 -else: 79 85 - libnames += [ 86 + - "libtesseract.so.5", 80 87 - "libtesseract.so.4", 81 88 - "libtesseract.so.3", 89 + - "libtesseract.5.dylib", 90 + - "libtesseract.4.dylib", 82 91 - ] 83 92 - 84 93 +libnames = [ "@tesseract@/lib/libtesseract.so" ] 85 94 86 95 g_libtesseract = None 87 96 88 - @@ -364,12 +331,12 @@ def init(lang=None): 97 + @@ -367,12 +331,12 @@ def init(lang=None): 89 98 try: 90 99 if lang: 91 100 lang = lang.encode("utf-8") ··· 103 112 ) 104 113 g_libtesseract.TessBaseAPISetVariable( 105 114 diff --git a/src/pyocr/tesseract.py b/src/pyocr/tesseract.py 106 - index 7c30852..44e8446 100644 115 + index 0fe0d20..c1fdd27 100644 107 116 --- a/src/pyocr/tesseract.py 108 117 +++ b/src/pyocr/tesseract.py 109 118 @@ -28,8 +28,7 @@ from .builders import DigitBuilder # backward compatibility ··· 193 202 stderr=subprocess.STDOUT 194 203 ) 195 204 diff --git a/tests/tests_libtesseract.py b/tests/tests_libtesseract.py 196 - index ad7fdc9..57e7a60 100644 205 + index a5d46d8..8b9e315 100644 197 206 --- a/tests/tests_libtesseract.py 198 207 +++ b/tests/tests_libtesseract.py 199 208 @@ -165,7 +165,8 @@ class TestLibTesseractRaw(BaseTest): ··· 217 226 218 227 self.assertEqual( 219 228 diff --git a/tests/tests_tesseract.py b/tests/tests_tesseract.py 220 - index 1a55567..a24d96f 100644 229 + index 18d01ef..593cf94 100644 221 230 --- a/tests/tests_tesseract.py 222 231 +++ b/tests/tests_tesseract.py 223 232 @@ -36,7 +36,7 @@ class TestTesseract(BaseTest): ··· 229 238 230 239 @patch("subprocess.Popen") 231 240 def test_version_error(self, popen): 232 - @@ -156,7 +156,7 @@ class TestTesseract(BaseTest): 241 + @@ -162,7 +162,7 @@ class TestTesseract(BaseTest): 233 242 for lang in ("eng", "fra", "jpn", "osd"): 234 243 self.assertIn(lang, langs) 235 244 popen.assert_called_once_with( ··· 238 247 startupinfo=None, creationflags=0, 239 248 stdout=subprocess.PIPE, stderr=subprocess.STDOUT 240 249 ) 241 - @@ -171,7 +171,7 @@ class TestTesseract(BaseTest): 250 + @@ -177,7 +177,7 @@ class TestTesseract(BaseTest): 242 251 self.assertEqual(te.exception.status, 1) 243 252 self.assertEqual("unable to get languages", te.exception.message) 244 253 popen.assert_called_once_with( ··· 247 256 startupinfo=None, creationflags=0, 248 257 stdout=subprocess.PIPE, stderr=subprocess.STDOUT 249 258 ) 250 - @@ -248,7 +248,7 @@ class TestTesseract(BaseTest): 259 + @@ -254,7 +254,7 @@ class TestTesseract(BaseTest): 251 260 self.assertEqual(status, 0) 252 261 self.assertEqual(error, message) 253 262 popen.assert_called_once_with( ··· 256 265 cwd=tmpdir, 257 266 startupinfo=None, 258 267 creationflags=0, 259 - @@ -271,7 +271,7 @@ class TestTesseract(BaseTest): 268 + @@ -277,7 +277,7 @@ class TestTesseract(BaseTest): 260 269 self.assertEqual(status, 0) 261 270 self.assertEqual(error, message) 262 271 popen.assert_called_with( ··· 265 274 cwd=tmpdir, 266 275 startupinfo=None, 267 276 creationflags=0, 268 - @@ -302,7 +302,7 @@ class TestTesseract(BaseTest): 277 + @@ -308,7 +308,7 @@ class TestTesseract(BaseTest): 269 278 self.assertEqual(result["angle"], 90) 270 279 self.assertEqual(result["confidence"], 9.30) 271 280 popen.assert_called_once_with( ··· 274 283 stdin=subprocess.PIPE, 275 284 shell=False, 276 285 startupinfo=None, 277 - @@ -338,7 +338,7 @@ class TestTesseract(BaseTest): 286 + @@ -344,7 +344,7 @@ class TestTesseract(BaseTest): 278 287 self.assertEqual(result["angle"], 90) 279 288 self.assertEqual(result["confidence"], 9.30) 280 289 popen.assert_called_once_with( ··· 283 292 stdin=subprocess.PIPE, 284 293 shell=False, 285 294 startupinfo=None, 286 - @@ -371,7 +371,7 @@ class TestTesseract(BaseTest): 295 + @@ -377,7 +377,7 @@ class TestTesseract(BaseTest): 287 296 self.assertEqual(result["angle"], 90) 288 297 self.assertEqual(result["confidence"], 9.30) 289 298 popen.assert_called_once_with( ··· 292 301 "--psm", "0", "-l", "osd"], 293 302 stdin=subprocess.PIPE, 294 303 shell=False, 295 - @@ -399,7 +399,7 @@ class TestTesseract(BaseTest): 304 + @@ -405,7 +405,7 @@ class TestTesseract(BaseTest): 296 305 with self.assertRaises(tesseract.TesseractError) as te: 297 306 tesseract.detect_orientation(self.image) 298 307 popen.assert_called_once_with( ··· 301 310 stdin=subprocess.PIPE, 302 311 shell=False, 303 312 startupinfo=None, 304 - @@ -433,7 +433,7 @@ class TestTesseract(BaseTest): 313 + @@ -439,7 +439,7 @@ class TestTesseract(BaseTest): 305 314 with self.assertRaises(tesseract.TesseractError) as te: 306 315 tesseract.detect_orientation(self.image) 307 316 popen.assert_called_once_with( ··· 310 319 stdin=subprocess.PIPE, 311 320 shell=False, 312 321 startupinfo=None, 313 - @@ -467,7 +467,7 @@ class TestTesseract(BaseTest): 322 + @@ -473,7 +473,7 @@ class TestTesseract(BaseTest): 314 323 self.assertEqual(result["angle"], 90) 315 324 self.assertEqual(result["confidence"], 9.30) 316 325 popen.assert_called_once_with( ··· 319 328 stdin=subprocess.PIPE, 320 329 shell=False, 321 330 startupinfo=None, 322 - @@ -500,7 +500,7 @@ class TestTesseract(BaseTest): 331 + @@ -506,7 +506,7 @@ class TestTesseract(BaseTest): 323 332 self.assertEqual(result["angle"], 90) 324 333 self.assertEqual(result["confidence"], 9.30) 325 334 popen.assert_called_once_with( ··· 328 337 stdin=subprocess.PIPE, 329 338 shell=False, 330 339 startupinfo=None, 331 - @@ -527,7 +527,7 @@ class TestTesseract(BaseTest): 340 + @@ -533,7 +533,7 @@ class TestTesseract(BaseTest): 332 341 with self.assertRaises(tesseract.TesseractError) as te: 333 342 tesseract.detect_orientation(self.image) 334 343 popen.assert_called_once_with( ··· 337 346 stdin=subprocess.PIPE, 338 347 shell=False, 339 348 startupinfo=None, 340 - @@ -561,7 +561,7 @@ class TestTesseract(BaseTest): 349 + @@ -567,7 +567,7 @@ class TestTesseract(BaseTest): 341 350 with self.assertRaises(tesseract.TesseractError) as te: 342 351 tesseract.detect_orientation(self.image) 343 352 popen.assert_called_once_with(