Skip to content

Commit

Permalink
Remove Python 2.6 support (#267)
Browse files Browse the repository at this point in the history
* remove python 2.6 (and some commented code) from .travis.yml

* update README to say we only support python 2.7.x, and update project url in setup.py

* use python 2.7 asserts in tests

* remove old comment
  • Loading branch information
bcail authored and Jon Stroop committed Dec 22, 2016
1 parent b2c6583 commit aad810e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 28 deletions.
10 changes: 0 additions & 10 deletions .travis.yml
Expand Up @@ -17,18 +17,8 @@ addons:
language: python

python:
- "2.6"
- "2.7"

# before_install:
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/liblcms.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libtiff.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libwebp.so /usr/lib/
# - sudo ln -s /usr/lib/`uname -i`-linux-gnu/libwebpdemux.so /usr/lib/

install:
- pip install -r requirements.txt

Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -15,7 +15,9 @@ Demos

Installation Instructions
-------------------------
These instructions are known to work on Ubuntu 12.04 or greater and Python 2.6.3 or greater (but less than 3.0.0). See below for some help with RedHat/CentOS and Debian.
Loris is only supported on Python 2.7.x. If you need to use Python 2.6, Loris v2.1.0 is the last version to support it.

These instructions are known to work on Ubuntu 12.04 or greater and Python 2.7.x (but not 3.x). See below for some help with RedHat/CentOS and Debian.

**Do Not!** Run `setup.py` until you've read the following:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -233,7 +233,7 @@ def _read(fname):
name='Loris',
author='Jon Stroop',
author_email='jpstroop@gmail.com',
url='https://github.com/pulibrary/loris',
url='https://github.com/loris-imageserver/loris',
description = ('IIIF Image API 2.0 Level 2 compliant Image Server'),
long_description=_read('README.md'),
license='Simplified BSD',
Expand Down
6 changes: 3 additions & 3 deletions tests/abstract_resolver.py
Expand Up @@ -21,8 +21,8 @@ def test_format(self):
def test_resolve(self):
expected_resolved = (self.expected_filepath, self.expected_format)
resolved = self.resolver.resolve(self.identifier)
self.assertEqual(resolved[0], expected_resolved[0])
self.assertEqual(resolved[1], expected_resolved[1])
self.assertSequenceEqual(resolved, expected_resolved)

def test_resolve_exception(self):
self.assertRaises(loris_exception.ResolverException, lambda: self.resolver.resolve(self.not_identifier))
with self.assertRaises(loris_exception.ResolverException):
self.resolver.resolve(self.not_identifier)
13 changes: 4 additions & 9 deletions tests/img_info_t.py
Expand Up @@ -135,12 +135,9 @@ def test_info_from_jpg_marked_as_jp2(self):
ident = '01%2f03%2f0001.jpg'
uri = '%s/%s' % (self.URI_BASE, ident)
formats = [ "jpg", "png", "gif", "webp" ]
#see http://stackoverflow.com/a/8673096
try:
with self.assertRaises(loris_exception.ImageInfoException) as cm:
img_info.ImageInfo.from_image_file(uri, fp, fmt, formats)
self.fail('should have thrown an ImageInfoException')
except loris_exception.ImageInfoException as iie:
self.assertEqual(iie.message, 'Invalid JP2 file')
self.assertEqual(cm.exception.message, 'Invalid JP2 file')

def test_info_from_invalid_src_format(self):
fp = path.join(self.test_img_dir, '01', '03', '0001.jpg')
Expand All @@ -149,11 +146,9 @@ def test_info_from_invalid_src_format(self):
uri = '%s/%s' % (self.URI_BASE, ident)
formats = [ "jpg", "png", "gif", "webp" ]
error_message = 'Didn\'t get a source format, or at least one we recognize ("invalid_format")'
try:
with self.assertRaises(loris_exception.ImageInfoException) as cm:
img_info.ImageInfo.from_image_file(uri, fp, fmt, formats)
self.fail('should have thrown an ImageInfoException')
except loris_exception.ImageInfoException as iie:
self.assertEqual(iie.message, error_message)
self.assertEqual(cm.exception.message, error_message)

def test_jpeg_info_from_image(self):
fp = self.test_jpeg_fp
Expand Down
4 changes: 2 additions & 2 deletions tests/resolver_t.py
Expand Up @@ -237,13 +237,13 @@ def test_simple_http_resolver(self):

ident = '0002'
resolved_path, fmt = self.app.resolver.resolve(ident)
self.assertTrue(resolved_path)
self.assertIsNotNone(resolved_path)
self.assertEqual(fmt, 'tif')
self.assertTrue(isfile(resolved_path))

ident = '0003'
resolved_path, fmt = self.app.resolver.resolve(ident)
self.assertTrue(resolved_path)
self.assertIsNotNone(resolved_path)
self.assertEqual(fmt, 'tif')
self.assertTrue(isfile(resolved_path))

Expand Down
3 changes: 1 addition & 2 deletions tests/simple_http_resolver_ut.py
Expand Up @@ -102,8 +102,7 @@ def test_does_not_exist(self):
def test_resolve_001(self):
expected_resolved = (self.expected_filepath, self.expected_format)
resolved = self.resolver.resolve(self.identifier)
self.assertEqual(resolved[0], expected_resolved[0])
self.assertEqual(resolved[1], expected_resolved[1])
self.assertSequenceEqual(resolved, expected_resolved)
# Make sure the file exists in the cache
self.assertTrue(os.path.isfile(self.expected_filepath))

Expand Down

0 comments on commit aad810e

Please sign in to comment.