Update version scripts to support Ghostscript 10.0
This commit is contained in:
+4
-5
@@ -12,10 +12,11 @@ from unittest.mock import patch
|
||||
|
||||
import pikepdf
|
||||
import pytest
|
||||
from packaging.version import Version
|
||||
from PIL import Image
|
||||
|
||||
import ocrmypdf
|
||||
from ocrmypdf._exec import ghostscript, tesseract
|
||||
from ocrmypdf._exec import tesseract
|
||||
from ocrmypdf.exceptions import ExitCode, MissingDependencyError
|
||||
from ocrmypdf.pdfa import file_claims_pdfa
|
||||
from ocrmypdf.pdfinfo import Colorspace, Encoding, PdfInfo
|
||||
@@ -178,7 +179,8 @@ def test_maximum_options(renderer, output_type, multipage, outpdf):
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
tesseract.version() >= '5', reason="tess 5 tries harder to find its files"
|
||||
Version(tesseract.version()) >= Version('5'),
|
||||
reason="tess 5 tries harder to find its files",
|
||||
)
|
||||
def test_tesseract_missing_tessdata(monkeypatch, resources, no_outpdf, tmpdir):
|
||||
monkeypatch.setenv("TESSDATA_PREFIX", os.fspath(tmpdir))
|
||||
@@ -777,9 +779,6 @@ def test_sidecar_nonempty(resources, outpdf):
|
||||
|
||||
@pytest.mark.parametrize('pdfa_level', ['1', '2', '3'])
|
||||
def test_pdfa_n(pdfa_level, resources, outpdf):
|
||||
if pdfa_level == '3' and ghostscript.version() < '9.19':
|
||||
pytest.xfail(reason='Ghostscript >= 9.19 required')
|
||||
|
||||
check_ocrmypdf(
|
||||
resources / 'ccitt.pdf',
|
||||
outpdf,
|
||||
|
||||
@@ -223,6 +223,12 @@ def test_version_comparison():
|
||||
need_version='4.1.1',
|
||||
version_parser=TesseractVersion,
|
||||
)
|
||||
vd.check_external_program(
|
||||
program="gs",
|
||||
package="ghostscript",
|
||||
version_checker=lambda: '10.0',
|
||||
need_version='9.50',
|
||||
)
|
||||
with pytest.raises(MissingDependencyError):
|
||||
vd.check_external_program(
|
||||
program="tesseract",
|
||||
|
||||
Reference in New Issue
Block a user