Fix installation for Python 3.7

Need to use private fork of ruffus for Python 3.7. Backward compatible with Python 3.6 for ruffus 2.6.3

Disable locale checking for 3.7 since the various fixes in that release should make it unnecessary.
This commit is contained in:
James R. Barlow
2018-07-02 16:47:14 -07:00
parent 73e02ae4ea
commit 7200623007
5 changed files with 21 additions and 11 deletions
+2 -1
View File
@@ -69,7 +69,8 @@ before_install: |
install:
- export PATH=$PWD/bin:$PATH
- pip3 install pycparser # py3.7 workaround for https://github.com/eliben/pycparser/issues/251
- pip3 install .
- pip3 install -r requirements.txt
- pip3 install --no-deps .
- pip3 install -r test_requirements.txt
script:
+7 -6
View File
@@ -1,10 +1,11 @@
# requirements.txt can be used to replicate the developer's build environment
# setup.py lists a separate set of requirements that are looser to simplify
# installation
ruffus == 2.6.3
Pillow == 5.1.0
reportlab == 3.4.0
PyPDF2 == 1.26.0
img2pdf == 0.2.4
cffi == 1.11.5
PyMuPDF == 1.12.5
img2pdf == 0.2.4
pikepdf == 0.2.2
Pillow >= 5.0.0, != 5.1.0 ; sys_platform == "darwin"
pycparser == 2.18
python-xmp-toolkit == 2.0.1
reportlab == 3.4.0
https://github.com/jbarlow83/ruffus/archive/py37.zip
+1 -1
View File
@@ -255,7 +255,7 @@ setup(
# block 5.1.0, broken wheels
'python-xmp-toolkit >= 2, < 3',
'reportlab >= 3.3.0', # oldest released version with sane image handling
'ruffus == 2.6.3', # pinned - ocrmypdf implements a 2.6.3 workaround
'ruffus == https://github.com/jbarlow83/ruffus/archive/py37.zip', # pinned - ocrmypdf implements a 2.6.3 workaround
],
extras_require={
'fitz': [], # Backward compatibility
+10 -3
View File
@@ -656,6 +656,9 @@ def traverse_ruffus_exception(e_args, options, log):
or something like:
[[(task, job, exc, value, stack)]]
For Ruffus > 2.6.4 the RethrownJobException has a list of exceptions like
e.job_exceptions = [(5-tuple), (5-tuple), ...]
Generally cross-process exception marshalling doesn't work well
and ruffus doesn't support because BaseException has its own
implementation of __reduce__ that attempts to reconstruct the
@@ -668,8 +671,8 @@ def traverse_ruffus_exception(e_args, options, log):
The exit code will be based on this, even if multiple exceptions occurred
at the same time."""
if isinstance(e_args, Sequence) and isinstance(e_args[0], str) and \
len(e_args) == 5:
if isinstance(e_args, Sequence) and isinstance(e_args[0], str) \
and len(e_args) == 5:
return do_ruffus_exception(e_args, options, log)
elif is_iterable_notstr(e_args):
for exc in e_args:
@@ -889,7 +892,11 @@ def run_pipeline():
except ruffus_exceptions.RethrownJobError as e:
if options.verbose:
_log.debug(str(e)) # stringify exception so logger doesn't have to
exitcode = traverse_ruffus_exception(e.args, options, _log)
if hasattr(e, 'job_exceptions'):
exceptions = e.job_exceptions
else:
exceptions = e.args # ruffus 2.6.3
exitcode = traverse_ruffus_exception(exceptions, options, _log)
if exitcode is None:
_log.error("Unexpected ruffus exception: " + str(e))
_log.error(repr(e))
+1
View File
@@ -840,6 +840,7 @@ def test_pdfa_n(spoof_tesseract_cache, pdfa_level, resources, outpdf):
assert pdfa_info['conformance'] == 'PDF/A-{}B'.format(pdfa_level)
@pytest.mark.skipif(sys.version_info >= (3, 7, 0), reason='better utf-8')
def test_bad_locale():
env = os.environ.copy()
env['LC_ALL'] = 'C'