lol
0
fork

Configure Feed

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

python310Packages.ocrmypdf: 13.6.0 -> 13.7.0

https://github.com/ocrmypdf/OCRmyPDF/blob/v13.7.0/docs/release_notes.rst

+23 -23
+2 -2
pkgs/development/python-modules/ocrmypdf/default.nix
··· 27 27 28 28 buildPythonPackage rec { 29 29 pname = "ocrmypdf"; 30 - version = "13.6.0"; 30 + version = "13.7.0"; 31 31 32 32 src = fetchFromGitHub { 33 33 owner = "ocrmypdf"; ··· 39 39 postFetch = '' 40 40 rm "$out/.git_archival.txt" 41 41 ''; 42 - hash = "sha256-EY0dXma6tyXLT8XogS5iFdVgJPrtwB9YVrplhDT4gWw="; 42 + hash = "sha256-cw2wZMPhWzxRpeM90g9NmuYBYpU13R2iDzs7a8SS/CY="; 43 43 }; 44 44 45 45 SETUPTOOLS_SCM_PRETEND_VERSION = version;
+21 -21
pkgs/development/python-modules/ocrmypdf/paths.patch
··· 1 1 diff --git a/src/ocrmypdf/_exec/ghostscript.py b/src/ocrmypdf/_exec/ghostscript.py 2 - index 4da65483..af750249 100644 2 + index 9e21c33c..21f134b3 100644 3 3 --- a/src/ocrmypdf/_exec/ghostscript.py 4 4 +++ b/src/ocrmypdf/_exec/ghostscript.py 5 - @@ -35,15 +35,7 @@ log = logging.getLogger(__name__) 5 + @@ -32,15 +32,7 @@ log = logging.getLogger(__name__) 6 6 # Most reliable what to get the bitness of Python interpreter, according to Python docs 7 7 _IS_64BIT = sys.maxsize > 2**32 8 8 ··· 20 20 21 21 def version(): 22 22 diff --git a/src/ocrmypdf/_exec/jbig2enc.py b/src/ocrmypdf/_exec/jbig2enc.py 23 - index 2e8a058b..65a09088 100644 23 + index 0f8f7392..db792b10 100644 24 24 --- a/src/ocrmypdf/_exec/jbig2enc.py 25 25 +++ b/src/ocrmypdf/_exec/jbig2enc.py 26 - @@ -14,7 +14,7 @@ from ocrmypdf.subprocess import get_version, run 26 + @@ -12,7 +12,7 @@ from ocrmypdf.subprocess import get_version, run 27 27 28 28 29 29 def version(): ··· 32 32 33 33 34 34 def available(): 35 - @@ -27,7 +27,7 @@ def available(): 35 + @@ -25,7 +25,7 @@ def available(): 36 36 37 37 def convert_group(*, cwd, infiles, out_prefix): 38 38 args = [ ··· 41 41 '-b', 42 42 out_prefix, 43 43 '-s', # symbol mode (lossy) 44 - @@ -46,7 +46,7 @@ def convert_group_mp(args): 44 + @@ -44,7 +44,7 @@ def convert_group_mp(args): 45 45 46 46 47 47 def convert_single(*, cwd, infile, outfile): ··· 51 51 proc = run(args, cwd=cwd, stdout=fstdout, stderr=PIPE) 52 52 proc.check_returncode() 53 53 diff --git a/src/ocrmypdf/_exec/pngquant.py b/src/ocrmypdf/_exec/pngquant.py 54 - index ca8a4542..d0544174 100644 54 + index 64e91139..ab5b9c49 100644 55 55 --- a/src/ocrmypdf/_exec/pngquant.py 56 56 +++ b/src/ocrmypdf/_exec/pngquant.py 57 - @@ -19,7 +19,7 @@ from ocrmypdf.subprocess import get_version, run 57 + @@ -17,7 +17,7 @@ from ocrmypdf.subprocess import get_version, run 58 58 59 59 60 60 def version(): ··· 63 63 64 64 65 65 def available(): 66 - @@ -46,7 +46,7 @@ def input_as_png(input_file: Path): 66 + @@ -44,7 +44,7 @@ def input_as_png(input_file: Path): 67 67 def quantize(input_file: Path, output_file: Path, quality_min: int, quality_max: int): 68 68 with input_as_png(input_file) as input_stream: 69 69 args = [ ··· 73 73 '--skip-if-larger', 74 74 '--quality', 75 75 diff --git a/src/ocrmypdf/_exec/tesseract.py b/src/ocrmypdf/_exec/tesseract.py 76 - index 01177cac..665f1145 100644 76 + index ad98836a..a12d3002 100644 77 77 --- a/src/ocrmypdf/_exec/tesseract.py 78 78 +++ b/src/ocrmypdf/_exec/tesseract.py 79 - @@ -114,7 +114,7 @@ class TesseractVersion(Version): 79 + @@ -111,7 +111,7 @@ class TesseractVersion(Version): 80 80 81 81 82 82 def version() -> str: ··· 84 84 + return get_version('@tesseract@', regex=r'tesseract\s(.+)') 85 85 86 86 87 - def has_user_words(): 88 - @@ -141,7 +141,7 @@ def get_languages(): 87 + def has_user_words() -> bool: 88 + @@ -138,7 +138,7 @@ def get_languages() -> set[str]: 89 89 msg += output 90 90 return msg 91 91 ··· 94 94 try: 95 95 proc = run( 96 96 args_tess, 97 - @@ -163,7 +163,7 @@ def get_languages(): 97 + @@ -160,7 +160,7 @@ def get_languages() -> set[str]: 98 98 99 99 100 - def tess_base_args(langs: List[str], engine_mode: Optional[int]) -> List[str]: 100 + def tess_base_args(langs: list[str], engine_mode: int | None) -> list[str]: 101 101 - args = ['tesseract'] 102 102 + args = ['@tesseract@'] 103 103 if langs: 104 104 args.extend(['-l', '+'.join(langs)]) 105 105 if engine_mode is not None: 106 106 diff --git a/src/ocrmypdf/_exec/unpaper.py b/src/ocrmypdf/_exec/unpaper.py 107 - index 479959ef..cc15fdec 100644 107 + index d7f24265..d14f85de 100644 108 108 --- a/src/ocrmypdf/_exec/unpaper.py 109 109 +++ b/src/ocrmypdf/_exec/unpaper.py 110 - @@ -69,7 +69,7 @@ class UnpaperImageTooLargeError(Exception): 110 + @@ -66,7 +66,7 @@ class UnpaperImageTooLargeError(Exception): 111 111 112 112 113 113 def version() -> str: ··· 115 115 + return get_version('@unpaper@') 116 116 117 117 118 - SUFFIXES = {'1': '.pbm', 'L': '.pgm', 'RGB': '.ppm'} 119 - @@ -123,7 +123,7 @@ def _setup_unpaper_io(input_file: Path) -> Iterator[Tuple[Path, Path, Path]]: 118 + SUPPORTED_MODES = {'1', 'L', 'RGB'} 119 + @@ -120,7 +120,7 @@ def _setup_unpaper_io(input_file: Path) -> Iterator[tuple[Path, Path, Path]]: 120 120 def run_unpaper( 121 - input_file: Path, output_file: Path, *, dpi: DecFloat, mode_args: List[str] 121 + input_file: Path, output_file: Path, *, dpi: DecFloat, mode_args: list[str] 122 122 ) -> None: 123 123 - args_unpaper = ['unpaper', '-v', '--dpi', str(round(dpi, 6))] + mode_args 124 124 + args_unpaper = ['@unpaper@', '-v', '--dpi', str(round(dpi, 6))] + mode_args 125 125 126 - with _setup_unpaper_io(input_file) as (input_pnm, output_pnm, tmpdir): 126 + with _setup_unpaper_io(input_file) as (input_png, output_pnm, tmpdir): 127 127 # To prevent any shenanigans from accepting arbitrary parameters in