diff --git a/.travis.yml b/.travis.yml index 14cafd8..c1aa3d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ python: - "3.6" install: - pip install tox tox-travis coveralls + - pip install setuptools -U - python setup.py install script: - tox diff --git a/iiif_validator/tests/info_json.py b/iiif_validator/tests/info_json.py index 25ee937..3879884 100644 --- a/iiif_validator/tests/info_json.py +++ b/iiif_validator/tests/info_json.py @@ -81,7 +81,7 @@ def run(self, result): self.validationInfo.check('type-is-int: width', type(t['width']), int, result) # extra version 3.0 checks if result.version[0] == "3": - self.validationInfo.check('correct-type', info['type'], "ImageService3", result, "Info.json missing required type of ImageService3.") + self.validationInfo.check('correct-type', 'type' in info and info['type'], "ImageService3", result, "Info.json missing required type of ImageService3.") self.validationInfo.check('license-renamed', 'license' in info, False, result,'license has been renamed rights in 3.0',warning=True) if 'rights' in info: self.validationInfo.check('type-is-uri: rights', info['rights'].startswith('http'), True, result,'Rights should be a single URI from Creative Commons, RightsStatements.org or URIs registered as extensions.') diff --git a/requirements.txt b/requirements.txt index 465f48f..8a22d70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ lxml bottle python-magic -pillow +# Versions including 7 don't support python 2.x +pillow<7 mock diff --git a/setup.py b/setup.py index 7dc6d3d..32f945b 100644 --- a/setup.py +++ b/setup.py @@ -43,10 +43,13 @@ long_description=open('README').read(), url='http://github.com/IIIF/image-api', install_requires=[ - "Pillow>=3.2.0", "bottle>=0.12.1", "python-magic>=0.4.12", "lxml>=3.7.0" ], + extras_require={ + ':python_version>="3.0"': ["Pillow>=3.2.0"], + ':python_version<"3.0"': ["Pillow==6.2.2"], + }, test_suite="tests", tests_require=["mock"])