Removed support for 2.6. Closes #150
This commit is contained in:
parent
4fca25baad
commit
423daf1dfe
22 changed files with 27 additions and 147 deletions
|
|
@ -12,13 +12,11 @@ before_install:
|
|||
|
||||
# command to install dependencies
|
||||
install:
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install --use-mirrors contextlib2 mock ordereddict unittest2; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --use-mirrors contextlib2 mock; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install --use-mirrors numpy; fi
|
||||
|
||||
# command to run tests
|
||||
script:
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then unit2 discover; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then python -m unittest discover; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then python -m unittest discover; fi
|
||||
|
||||
|
|
|
|||
|
|
@ -95,18 +95,16 @@ documentation or use pip.
|
|||
* setuptools
|
||||
* matplotlib
|
||||
* pillow
|
||||
* contextlib2 (python 2.6, 2.7 only)
|
||||
* mock (python 2.6, 2.7 only)
|
||||
* ordereddict (python 2.6 only)
|
||||
* contextlib2 (2.7 only)
|
||||
* mock (2.7 only)
|
||||
|
||||
Glymur's been tested on the following linux platforms without any unexpected
|
||||
Glymur 0.6 been tested on the following linux platforms without any unexpected
|
||||
difficulties:
|
||||
|
||||
* OpenSUSE 12.3
|
||||
* Fedora 17, 18, 19
|
||||
* OpenSUSE 13.1
|
||||
* Fedora 19
|
||||
* Raspian
|
||||
* Travis CI (currently Ubuntu 12.04?)
|
||||
* CentOS 6.4
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ some very limited support for reading JPX metadata. For instance,
|
|||
**asoc** and **labl** boxes are recognized, so GMLJP2 metadata can
|
||||
be retrieved from such JPX files.
|
||||
|
||||
Glymur works on Python 2.6, 2.7, and 3.3.
|
||||
Glymur 0.6 works on Python versions 2.7, 3.3 and 3.4. If you have 2.6, you should
|
||||
use the 0.5 series.
|
||||
|
||||
OpenJPEG Installation
|
||||
=====================
|
||||
|
|
|
|||
|
|
@ -8,5 +8,3 @@ Here's an incomplete list of what I'd like to focus on in the future.
|
|||
* investigate using CFFI or cython instead of ctypes to wrap openjp2
|
||||
* investigate adding write support for UUID/XMP boxes (potentially a big project)
|
||||
* investigate JPIP (likely to be an even bigger project)
|
||||
|
||||
Support for Python 2.6 will be dropped with the 0.6.0 release.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"""glymur - read, write, and interrogate JPEG 2000 files
|
||||
"""
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from glymur import version
|
||||
__version__ = version.version
|
||||
|
|
@ -10,15 +11,8 @@ from .jp2dump import jp2dump
|
|||
|
||||
from . import data
|
||||
|
||||
|
||||
# unittest2 only in python-2.6 (pylint/python2.7 issue)
|
||||
# pylint: disable=F0401
|
||||
def runtests():
|
||||
"""Discover and run all tests for the glymur package.
|
||||
"""
|
||||
if sys.hexversion <= 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
suite = unittest.defaultTestLoader.discover(__path__[0])
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ References
|
|||
|
||||
# pylint: disable=C0302,R0903,R0913
|
||||
|
||||
from collections import OrderedDict
|
||||
import copy
|
||||
import datetime
|
||||
import io
|
||||
|
|
@ -23,16 +24,9 @@ import struct
|
|||
import sys
|
||||
import uuid
|
||||
import warnings
|
||||
import xml
|
||||
import xml.etree.cElementTree as ET
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
# pylint: disable=F0401,E0611
|
||||
from ordereddict import OrderedDict
|
||||
from xml.etree.cElementTree import XMLParserError as ParseError
|
||||
else:
|
||||
from xml.etree.cElementTree import ParseError
|
||||
from collections import OrderedDict
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .codestream import Codestream
|
||||
|
|
@ -2330,10 +2324,10 @@ class XMLBox(Jp2kBox):
|
|||
try:
|
||||
elt = ET.fromstring(text.encode('utf-8'))
|
||||
xml = ET.ElementTree(elt)
|
||||
except ParseError as parse_error:
|
||||
except ET.ParseError as err:
|
||||
msg = 'A problem was encountered while parsing an XML box:'
|
||||
msg += '\n\n\t"{0}"\n\nNo XML was retrieved.'
|
||||
msg = msg.format(str(parse_error))
|
||||
msg = msg.format(str(err))
|
||||
warnings.warn(msg, UserWarning)
|
||||
xml = None
|
||||
|
||||
|
|
|
|||
|
|
@ -5,17 +5,10 @@ Tests for libopenjp2 wrapping functions.
|
|||
# W0142: using kwargs is ok in this context
|
||||
# pylint: disable=R0904,W0142
|
||||
|
||||
# unittest2 is python-2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,12 @@
|
|||
"""
|
||||
Tests for OpenJPEG module.
|
||||
"""
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
# pylint: disable=E1101,R0904
|
||||
|
||||
import ctypes
|
||||
import re
|
||||
import sys
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import glymur
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,7 @@ import sys
|
|||
import tempfile
|
||||
import warnings
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
if sys.hexversion <= 0x03030000:
|
||||
from mock import patch
|
||||
|
|
|
|||
|
|
@ -8,18 +8,11 @@ Test suite for codestream parsing.
|
|||
# tempfile.TemporaryDirectory, unittest.assertWarns introduced in 3.2
|
||||
# pylint: disable=E1101
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
from glymur import Jp2k
|
||||
import glymur
|
||||
|
|
|
|||
|
|
@ -15,11 +15,7 @@ import imp
|
|||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
if sys.hexversion <= 0x03030000:
|
||||
from mock import patch
|
||||
|
|
|
|||
|
|
@ -7,18 +7,11 @@ These tests deal with JPX/JP2/J2K images in the format-corpus repository.
|
|||
# E1101: assertWarns introduced in python 3.2
|
||||
# pylint: disable=E1101
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import os
|
||||
from os.path import join
|
||||
import re
|
||||
import sys
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import glymur
|
||||
from glymur import Jp2k
|
||||
|
|
|
|||
|
|
@ -5,17 +5,10 @@ ICC profile tests.
|
|||
# unittest doesn't work well with R0904.
|
||||
# pylint: disable=R0904
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ Test suite specifically targeting JP2 box layout.
|
|||
# E1103: return value from read may be list or np array
|
||||
# pylint: disable=E1103
|
||||
|
||||
# F0401: unittest2 is needed on python-2.6 (pylint on 2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
# R0902: More than 7 instance attributes are just fine for testing.
|
||||
# pylint: disable=R0902
|
||||
|
||||
|
|
@ -26,13 +23,9 @@ import tempfile
|
|||
import uuid
|
||||
from uuid import UUID
|
||||
import xml.etree.cElementTree as ET
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
import glymur
|
||||
|
|
@ -917,7 +910,6 @@ class TestRepr(unittest.TestCase):
|
|||
self.assertEqual(newbox.bits_per_component, (8, 8, 16))
|
||||
self.assertEqual(newbox.signed, (True, False, True))
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x02070000, "Requires 2.7+")
|
||||
def test_xml_box(self):
|
||||
"""Verify xml box repr."""
|
||||
elt = ET.fromstring('<?xml version="1.0"?><data>0</data>')
|
||||
|
|
@ -948,7 +940,6 @@ class TestRepr(unittest.TestCase):
|
|||
self.assertEqual(box.vendor_feature, newbox.vendor_feature)
|
||||
self.assertEqual(box.vendor_mask, newbox.vendor_mask)
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x02070000, "Requires 2.7+")
|
||||
def test_uuid_box(self):
|
||||
"""Verify uuid repr method."""
|
||||
uuid_instance = uuid.UUID('00000000-0000-0000-0000-000000000000')
|
||||
|
|
@ -966,7 +957,6 @@ class TestRepr(unittest.TestCase):
|
|||
else:
|
||||
self.assertRegex(repr(box), regexp)
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x02070000, "Requires 2.7+")
|
||||
def test_contiguous_codestream_box(self):
|
||||
"""Verify contiguous codestream box repr method."""
|
||||
jp2file = glymur.data.nemo()
|
||||
|
|
|
|||
|
|
@ -7,13 +7,9 @@ import os
|
|||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
|
||||
import glymur
|
||||
from glymur import Jp2k
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ Test suite specifically targeting JP2 box layout.
|
|||
# E1103: return value from read may be list or np array
|
||||
# pylint: disable=E1103
|
||||
|
||||
# F0401: unittest2 is needed on python-2.6 (pylint on 2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
# R0902: More than 7 instance attributes are just fine for testing.
|
||||
# pylint: disable=R0902
|
||||
|
||||
|
|
@ -21,6 +18,7 @@ import os
|
|||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
import warnings
|
||||
import xml.etree.cElementTree as ET
|
||||
|
||||
|
|
@ -34,11 +32,6 @@ if sys.hexversion <= 0x03030000:
|
|||
else:
|
||||
from unittest.mock import patch
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
|
||||
import glymur
|
||||
from glymur import Jp2k
|
||||
from glymur.jp2box import ColourSpecificationBox, ContiguousCodestreamBox
|
||||
|
|
|
|||
|
|
@ -17,14 +17,10 @@ import shutil
|
|||
import struct
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
import uuid
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -47,9 +43,6 @@ def load_tests(loader, tests, ignore):
|
|||
if os.name == "nt":
|
||||
# Can't do it on windows, temporary file issue.
|
||||
return tests
|
||||
if sys.hexversion < 0x02070000:
|
||||
# Don't bother with doctests on 2.6 for the time being.
|
||||
return tests
|
||||
if glymur.lib.openjp2.OPENJP2 is not None:
|
||||
tests.addTests(doctest.DocTestSuite('glymur.jp2k'))
|
||||
return tests
|
||||
|
|
|
|||
|
|
@ -27,16 +27,9 @@ suite.
|
|||
# asserWarns introduced in python 3.2 (python2.7/pylint issue)
|
||||
# pylint: disable=E1101
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import warnings
|
||||
|
||||
|
|
|
|||
|
|
@ -8,18 +8,11 @@ seem like logical negative tests to add.
|
|||
# R0904: Not too many methods in unittest.
|
||||
# pylint: disable=R0904
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
|
|
|||
|
|
@ -6,18 +6,11 @@ suite.
|
|||
# R0904: Seems like pylint is fooled in this situation
|
||||
# pylint: disable=R0904,C0103
|
||||
|
||||
# unittest2 is python2.6 only (pylint/python-2.7)
|
||||
# pylint: disable=F0401
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
from .fixtures import read_image, NO_READ_BACKEND, NO_READ_BACKEND_MSG
|
||||
from .fixtures import OPJ_DATA_ROOT, opj_data_file
|
||||
|
|
|
|||
|
|
@ -17,11 +17,7 @@ import sys
|
|||
import tempfile
|
||||
import warnings
|
||||
from xml.etree import cElementTree as ET
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
import unittest
|
||||
|
||||
if sys.hexversion < 0x03000000:
|
||||
from StringIO import StringIO
|
||||
|
|
@ -626,8 +622,6 @@ class TestPrinting(unittest.TestCase):
|
|||
expected = '\n'.join(lines)
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x02070000,
|
||||
"Differences in XML printing between 2.6 and 2.7")
|
||||
def test_xmp(self):
|
||||
"""Verify the printing of a UUID/XMP box."""
|
||||
j = glymur.Jp2k(self.jp2file)
|
||||
|
|
@ -699,8 +693,6 @@ class TestPrinting(unittest.TestCase):
|
|||
expected = '\n'.join(lst)
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
@unittest.skipIf(sys.hexversion < 0x02070000,
|
||||
"Differences in XML printing between 2.6 and 2.7")
|
||||
@unittest.skipIf(OPJ_DATA_ROOT is None,
|
||||
"OPJ_DATA_ROOT environment variable not set")
|
||||
def test_xml(self):
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -20,13 +20,9 @@ instllrqrs = ['numpy>=1.4.1']
|
|||
if sys.hexversion < 0x03030000:
|
||||
instllrqrs.append('contextlib2>=0.4')
|
||||
instllrqrs.append('mock>=1.0.1')
|
||||
if sys.hexversion < 0x02070000:
|
||||
instllrqrs.append('ordereddict>=1.1')
|
||||
instllrqrs.append('unittest2>=0.5.1')
|
||||
kwargs['install_requires'] = instllrqrs
|
||||
|
||||
clssfrs = ["Programming Language :: Python",
|
||||
"Programming Language :: Python :: 2.6",
|
||||
"Programming Language :: Python :: 2.7",
|
||||
"Programming Language :: Python :: 3.3",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue