Travis: hack in qpdf appimage version
qpdf from appimage does not report its version with --version if renamed or accessed via symlink. Use an environment variable to supply it where needed.
This commit is contained in:
+1
-2
@@ -68,6 +68,7 @@ before_install: |
|
||||
sudo dpkg -i packages/unpaper_6.1-1.deb
|
||||
wget -q 'https://github.com/qpdf/qpdf/releases/download/release-qpdf-8.0.2/qpdf-8.0.2-x86_64.AppImage' -O bin/qpdf
|
||||
chmod +x bin/qpdf
|
||||
export OCRMYPDF_QPDF_APPIMAGE=8.0.2
|
||||
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||
brew update && brew bundle --file=.travis/Brewfile
|
||||
pip3 install --upgrade pip
|
||||
@@ -76,13 +77,11 @@ before_install: |
|
||||
|
||||
install:
|
||||
- export PATH=$PWD/bin:$PATH
|
||||
- qpdf --version
|
||||
- pip3 install ".$EXTRAS"
|
||||
- pip3 install -r test_requirements.txt
|
||||
|
||||
script:
|
||||
- tesseract --version
|
||||
- qpdf --version
|
||||
- pytest -n auto
|
||||
|
||||
deploy:
|
||||
|
||||
@@ -28,6 +28,7 @@ from setuptools import setup, find_packages # nopep8
|
||||
from subprocess import STDOUT, check_output, CalledProcessError # nopep8
|
||||
from collections.abc import Mapping # nopep8
|
||||
import re # nopep8
|
||||
import os # nopep8
|
||||
|
||||
|
||||
missing_program = '''
|
||||
@@ -184,12 +185,13 @@ if not forced and command.startswith('install') or \
|
||||
package='unpaper',
|
||||
optional=True
|
||||
)
|
||||
check_external_program(
|
||||
program='qpdf',
|
||||
need_version='7.0.0', # test suite known to fail on 5.1.1
|
||||
package='qpdf',
|
||||
version_check_args=['--version']
|
||||
)
|
||||
if not os.environ.get('OCRMYPDF_QPDF_APPIMAGE'):
|
||||
check_external_program(
|
||||
program='qpdf',
|
||||
need_version='7.0.0', # test suite known to fail on 5.1.1
|
||||
package='qpdf',
|
||||
version_check_args=['--version']
|
||||
)
|
||||
|
||||
if 'upload' in sys.argv[1:]:
|
||||
print('Use twine to upload the package - setup.py upload is insecure')
|
||||
|
||||
@@ -30,7 +30,9 @@ from ..helpers import re_symlink
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def version():
|
||||
return get_version('qpdf', regex=r'qpdf version (.+)')
|
||||
if 'OCRMYPDF_QPDF_APPIMAGE' in os.environ:
|
||||
return os.environ['OCRMYPDF_QPDF_APPIMAGE']
|
||||
return get_version('qpdf', regex=r'qpdf version (.+)')
|
||||
|
||||
|
||||
def check(input_file, log=None):
|
||||
|
||||
Reference in New Issue
Block a user