diff --git a/.travis.yml b/.travis.yml index d3b328ae..2575bd0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,6 @@ cache: matrix: include: - - os: linux - sudo: required - language: python - python: 3.4 - os: linux sudo: required language: python diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index edcfc01b..58292eb1 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -3,6 +3,13 @@ RELEASE NOTES OCRmyPDF uses `semantic versioning `_. +next +==== + +- Python 3.4 compatibility dropped +- Remove deprecated API functions: ocrmypdf.main +- Remove OCRmyPDF.sh script + v4.5.3 ====== diff --git a/docs/installation.rst b/docs/installation.rst index 6f8c540f..761d2d2d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -139,7 +139,7 @@ Install or upgrade the required Homebrew packages, if any are missing: brew install libxml2 libffi leptonica brew install unpaper # optional -Python 3.4, 3.5 and 3.6 are supported. +Python 3.5 and 3.6 are supported. Install the required Tesseract OCR engine with the language packs you plan to use: @@ -290,7 +290,7 @@ where /c/Users/sampleuser is a Unix representation of the Windows path C:\\Users Installing HEAD revision from sources ------------------------------------- -If you have ``git`` and Python 3.4 or newer installed, you can install from source. When the ``pip`` installer runs, +If you have ``git`` and Python 3.5 or newer installed, you can install from source. When the ``pip`` installer runs, it will alert you if dependencies are missing. To install the HEAD revision from sources in the current Python 3 environment: diff --git a/ocrmypdf/pageinfo.py b/ocrmypdf/pageinfo.py index a54ec385..4b558f58 100644 --- a/ocrmypdf/pageinfo.py +++ b/ocrmypdf/pageinfo.py @@ -9,13 +9,6 @@ import sys import PyPDF2 as pypdf from collections import namedtuple -try: - from math import isclose -except ImportError: - def isclose(a, b, rel_tol=1e-9): - "Python 3.4 does not have math.isclose()" - diff = abs(b - a) - return diff <= abs(rel_tol * b) or diff <= abs(rel_tol * a) matrix_mult = pypdf.pdf.utils.matrixMultiply diff --git a/ocrmypdf/pdfa.py b/ocrmypdf/pdfa.py index c06df910..b10262f8 100644 --- a/ocrmypdf/pdfa.py +++ b/ocrmypdf/pdfa.py @@ -122,10 +122,6 @@ def generate_pdfa_ps(target_filename, pdfmark, icc='sRGB'): f.write(ps) -# The old name is generate_pdfa_def -- now deprecated -generate_pdfa_def = generate_pdfa_ps - - def file_claims_pdfa(filename): """Determines if the file claims to be PDF/A compliant diff --git a/tests/test_main.py b/tests/test_main.py index 2997763e..2adfa578 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -571,7 +571,6 @@ def test_non_square_resolution(renderer, spoof_tesseract_cache, assert in_pageinfo[0]['yres'] == out_pageinfo[0]['yres'] -@pytest.mark.skipif(sys.version_info < (3, 5), reason="needs math.isclose") @pytest.mark.parametrize('renderer', [ 'hocr', 'tesseract' @@ -814,7 +813,6 @@ def test_form_xobject(spoof_tesseract_noop, resources, outpdf): env=spoof_tesseract_noop) -@pytest.mark.skipif(sys.version_info < (3, 5), reason="needs math.isclose") @pytest.mark.parametrize('renderer', [ 'hocr', 'tesseract', diff --git a/tests/test_pageinfo.py b/tests/test_pageinfo.py index dcb4ab90..0f70b1a4 100644 --- a/tests/test_pageinfo.py +++ b/tests/test_pageinfo.py @@ -35,7 +35,6 @@ def test_single_page_text(outdir): assert len(page['images']) == 0 -@pytest.mark.skipif(sys.version_info < (3, 5), reason="needs Path.read_bytes") def test_single_page_image(outdir): filename = outdir / 'image-mono.pdf'