From 5ec38a4bed1d263356e3590160321abd07469457 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 2 Jan 2017 18:17:38 -0800 Subject: [PATCH 1/5] Update requirements files and documentation for Python 3.6 - no code changes --- .travis.yml | 5 +++-- dev_requirements.txt | 13 +++++++++---- docs/installation.rst | 4 ++++ requirements.txt | 6 +++--- setup.py | 6 +++++- test_requirements.txt | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index faa99fdc..c6ce2b7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,9 @@ cache: - tests/cache python: - - 3.4 - - 3.5 + - "3.4" + - "3.5" + - "3.6-dev" # 3.6 not available yet before_cache: - rm -f $HOME/.cache/pip/log/debug.log diff --git a/dev_requirements.txt b/dev_requirements.txt index ab16ab10..f707b0e4 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,9 @@ -check-manifest>=0.33 -setuptools-scm>=1.11.1 -twine>=1.8.1 -coverage>=4.2 \ No newline at end of file +check-manifest >= 0.34 +twine >= 1.8.1 +coverage >= 4.3.1 +pytest-xdist >= 1.15.0 + +# Known good versions: 1.11.1 +# Known broken versions: 1.15.0 +setuptools-scm == 1.11.1 +setuptools-scm-git-archive == 1.0 \ No newline at end of file diff --git a/docs/installation.rst b/docs/installation.rst index cdd7da33..dce38235 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -78,6 +78,8 @@ In this worked example, the current working directory contains an input file cal docker run --rm -v "$(pwd):/home/docker" ocrmypdf --skip-text test.pdf output.pdf +.. note:: The working directory should be a writable local volume or Docker may not have permission to access it. + Note that ``ocrmypdf`` has its own separate ``-v VERBOSITYLEVEL`` argument to control debug verbosity. All Docker arguments should before the ``ocrmypdf`` image name and all arguments to ``ocrmypdf`` should be listed after. @@ -105,6 +107,8 @@ 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. + Install the required Tesseract OCR engine with the language packs you plan to use: .. code-block:: bash diff --git a/requirements.txt b/requirements.txt index eb8b9f68..6567ba8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ # setup.py lists a separate set of requirements that are looser to simplify # installation ruffus==2.6.3 -Pillow==3.3.0 -reportlab==3.2.0 +Pillow==4.0.0 +reportlab==3.3.0 PyPDF2==1.26 img2pdf==0.2.1 -cffi==1.5.2 +cffi==1.9.1 diff --git a/setup.py b/setup.py index 224acbb1..14326f2f 100644 --- a/setup.py +++ b/setup.py @@ -196,6 +196,9 @@ setup( keywords=['PDF', 'OCR', 'optical character recognition', 'PDF/A', 'scanning'], classifiers=[ "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: End Users/Desktop", @@ -211,7 +214,8 @@ setup( "Topic :: Text Processing :: Linguistic", ], setup_requires=[ - 'setuptools_scm', + 'setuptools-scm', + 'setuptools-scm-git-archive', 'cffi>=1.5.0', 'pytest-runner' ], diff --git a/test_requirements.txt b/test_requirements.txt index 7a13b208..11dafdd5 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1 +1 @@ -pytest>=2.7.2 +pytest >= 2.7.2 From 7be4e9c9198630cf75aecf1233c453dd6e07671b Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 3 Jan 2017 00:25:57 -0800 Subject: [PATCH 2/5] fix setuptools-scm for py 3.4, 3.5 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 14326f2f..32fb8bfc 100644 --- a/setup.py +++ b/setup.py @@ -214,7 +214,7 @@ setup( "Topic :: Text Processing :: Linguistic", ], setup_requires=[ - 'setuptools-scm', + 'setuptools-scm == 1.11.1', # pinned because upstream keeps breaking things 'setuptools-scm-git-archive', 'cffi>=1.5.0', 'pytest-runner' From 9e004c3ec022ae94570a9447b8892ad52b63e014 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 3 Jan 2017 00:34:26 -0800 Subject: [PATCH 3/5] Another attempt at py 3.4/3.5 Revert to exactly what the previous passing build specified. --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 32fb8bfc..383148e5 100644 --- a/setup.py +++ b/setup.py @@ -214,8 +214,7 @@ setup( "Topic :: Text Processing :: Linguistic", ], setup_requires=[ - 'setuptools-scm == 1.11.1', # pinned because upstream keeps breaking things - 'setuptools-scm-git-archive', + 'setuptools_scm', 'cffi>=1.5.0', 'pytest-runner' ], From c48acf165ae557076de86bc3d9e8e5a5dd309f2a Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 3 Jan 2017 00:45:33 -0800 Subject: [PATCH 4/5] v4.3.5: Python 3.6 compatibility --- RELEASE_NOTES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 46f29cf1..7545e4bf 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -3,6 +3,12 @@ RELEASE NOTES OCRmyPDF uses `semantic versioning `_. +v4.3.5: +======= + +- Update documentation to confirm Python 3.6.0 compatibility. No code changes were needed, so many earlier versions are likely supported. + + v4.3.4: ======= From 482692396e78caf38bae923cd322498a49f32ac7 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 17 Jan 2017 08:17:56 -0800 Subject: [PATCH 5/5] Add installation instructions for Ubuntu 16.04 --- docs/installation.rst | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index dce38235..224c2262 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -140,6 +140,44 @@ The command line program should now be available: ocrmypdf --help + +Installing on Ubuntu 16.04 LTS +------------------------------ + +No package is currently available for Ubuntu 16.04, but you can install the dependencies manually: + +.. code-block:: bash + + sudo apt-get update + sudo apt-get install \ + unpaper \ + ghostscript \ + tesseract-ocr \ + qpdf \ + python3-pip \ + python3-pil \ + python3-pytest \ + python3-reportlab \ + python3-ruffus \ + python3-cffi + +If you wish install OCRmyPDF to the system Python, then install as follows (note this installs new packages +into your system Python, which could interfere with other programs): + +.. code-block:: bash + + sudo pip3 install ocrmypdf + +If you wish to install OCRmyPDF to a virtual environment to isolate the system Python, you can +follow these steps. + +.. code-block:: bash + + python3 -m venv --system-site-packages venv-ocrmypdf + source venv-ocrmypdf/bin/activate + pip3 install ocrmypdf + + Installing on Ubuntu 14.04 LTS ------------------------------ @@ -157,7 +195,6 @@ Update apt-get: .. code-block:: bash sudo apt-get update - sudo apt-get upgrade Install system dependencies: