Simplified test requirements, dropping scikit-image and freeimage.

closes #51
This commit is contained in:
John Evans 2013-07-16 18:45:25 -04:00
commit a1c779b729
3 changed files with 19 additions and 63 deletions

View file

@ -56,17 +56,13 @@ packages/RPMs/ports/whatever without going through pip.
Mac OS X Mac OS X
-------- --------
All the necessary packages are available to use glymur with Python 3.3 via All the necessary packages are available to use glymur with Python 3.3 via
MacPorts. A minimal set of ports includes MacPorts. You should install the following set of ports:
* python33 * python33
* py33-numpy * py33-numpy
* py33-distribute * py33-distribute
* py33-matplotlib (optional, for running certain tests)
To run all the testing, one of the following combinations of ports must * py33-Pillow (optional, for running certain tests)
additionally be installed:
* py33-scikit-image and either py33-Pillow or freeimage
* py33-matplotlib and py33-Pillow
MacPorts supplies both OpenJPEG 1.5.0 and OpenJPEG 2.0.0. As previously MacPorts supplies both OpenJPEG 1.5.0 and OpenJPEG 2.0.0. As previously
mentioned, the 2.0.0 official release is not supported (although the 2.0+ mentioned, the 2.0.0 official release is not supported (although the 2.0+
@ -98,15 +94,9 @@ meet the minimal set of requirements for running glymur.
* python3-matplotlib (for running tests) * python3-matplotlib (for running tests)
* python3-matplotlib-tk (or whichever matplotlib backend you prefer) * python3-matplotlib-tk (or whichever matplotlib backend you prefer)
A few tests still will not run, however, unless one of the following Pillow is also needed in order to run the maximum number of tests, so
combinations of RPMs / Python packages is installed. go ahead and install Pillow via pip since Pillow is not yet available
in Fedora 18 default repositories::
* scikit-image and either Pillow or freeimage
* matplotlib and Pillow
The 2nd route is probably the easiest, so go ahead and install Pillow
via pip since Pillow is not yet available in Fedora 18 default
repositories::
$ yum install python3-devel # pip needs this in order to compile Pillow $ yum install python3-devel # pip needs this in order to compile Pillow
$ yum install python3-pip $ yum install python3-pip
@ -115,8 +105,7 @@ repositories::
Fedora 17 Fedora 17
''''''''' '''''''''
Fedora 17 ships with Python 3.2 and 2.7, but OpenJPEG is only at version 1.4, Fedora 17 ships with Python 2.7 and OpenJPEG 1.4.
so these steps detail working with Python 2.7 and the svn version of OpenJPEG.
Required RPMs include:: Required RPMs include::
@ -137,11 +126,8 @@ combinations of RPMs / Python packages is installed.
scikit-image was not available in the Fedora 17 default repositories, but scikit-image was not available in the Fedora 17 default repositories, but
it was installable via pip:: it was installable via pip::
$ yum install Cython # pip needs this in order to compile scikit-image $ yum install python-devel # pip needs this in order to compile Pillow
$ yum install python-devel # pip needs this in order to compile scikit-image $ pip-python3 install Pillow --user
$ yum install freeimage # scikit-image uses this as a backend
$ yum install scipy # needed by scikit-image
$ pip-python install scikit-image --user
$ pip-python install contextlib2 --user $ pip-python install contextlib2 --user
$ export PYTHONPATH=$HOME/.local/lib/python2.7/site-packages:$PYTHONPATH $ export PYTHONPATH=$HOME/.local/lib/python2.7/site-packages:$PYTHONPATH

View file

@ -19,30 +19,15 @@ import pkg_resources
from glymur.lib import openjp2 as opj2 from glymur.lib import openjp2 as opj2
# Need some combination of matplotlib, PIL, or scikits-image for reading msg = "Matplotlib with the PIL backend must be available in order to run the "
# other image formats.
no_read_backend = True
msg = "Either scikit-image with the freeimage backend or matplotlib "
msg += "with the PIL backend must be available in order to run the "
msg += "tests in this suite." msg += "tests in this suite."
no_read_backend_msg = msg no_read_backend_msg = msg
try: try:
import skimage.io from PIL import Image
try: from matplotlib.pyplot import imread
skimage.io.use_plugin('freeimage') no_read_backend = False
from skimage.io import imread
no_read_backend = False
except RuntimeError:
skimage.io.use_plugin('PIL')
from skimage.io import imread
no_read_backend = False
except: except:
try: no_read_backend = True
from PIL import Image
from matplotlib.pyplot import imread
no_read_backend = False
except:
pass
from glymur import Jp2k from glymur import Jp2k
import glymur import glymur

View file

@ -19,30 +19,15 @@ import numpy as np
from glymur.lib import openjp2 as opj2 from glymur.lib import openjp2 as opj2
# Need some combination of matplotlib, PIL, or scikits-image for reading msg = "Matplotlib with the PIL backend must be available in order to run the "
# other image formats.
no_read_backend = True
msg = "Either scikit-image with the freeimage backend or matplotlib "
msg += "with the PIL backend must be available in order to run the "
msg += "tests in this suite." msg += "tests in this suite."
no_read_backend_msg = msg no_read_backend_msg = msg
try: try:
import skimage.io from PIL import Image
try: from matplotlib.pyplot import imread
skimage.io.use_plugin('freeimage') no_read_backend = False
from skimage.io import imread
no_read_backend = False
except RuntimeError:
skimage.io.use_plugin('PIL')
from skimage.io import imread
no_read_backend = False
except: except:
try: no_read_backend = True
from PIL import Image
from matplotlib.pyplot import imread
no_read_backend = False
except:
pass
from glymur import Jp2k from glymur import Jp2k
import glymur import glymur