scikit-image/scikit-image — pull request #1084 by blink1073 (2014-07-26 12:30:55+00:00)
Title: Major Overhaul of Travis Build

- Test against python 2.6, 2.7, 3.3, and 3.4 on Travis
- Make networkx and matplotlib optional dependencies for testing. Test first without, and then with them.
- Make PIL a required dependency - we could optionally allow one of a number of
io plugins to be installed and make the tests pass with each
- Make compatible with numpy 1.6 and py2.6 (does not support dict generators)
- Work around the fact that `restoration/unwrap` does not work on py26
-- Had to skip those tests, not run doctests, and not run the tests in `docs/examples`
- Add `version_requirements` helpers in `skimage.util`, with tests
- Bump required version of Cython to 0.19 due to relative imports error

Numpy 1.6 Errors that were fixed:

```python
======================================================================
ERROR: Test a grayscale float image
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/blink1073/scikit-image/skimage/exposure/tests/test_exposure.py", line 170, in test_adapthist_grayscale
nbins=128)
File "/home/travis/build/blink1073/scikit-image/skimage/exposure/_adapthist.py", line 78, in equalize_adapthist
out = _clahe(image, ntiles_x, ntiles_y, clip_limit * nbins, nbins)
File "/home/travis/build/blink1073/scikit-image/skimage/exposure/_adapthist.py", line 144, in _clahe
image = np.pad(image, ((0, h_pad), (0, w_pad)), 'reflect')
AttributeError: 'module' object has no attribute 'pad'
======================================================================
ERROR: test_reconstruction.test_invalid_selem
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/blink1073/scikit-image/skimage/morphology/tests/test_reconstruction.py", line 94, in test_invalid_selem
selem=np.ones((4, 4)))
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/numpy/testing/utils.py", line 1008, in assert_raises
return nose.tools.assert_raises(*args,**kwargs)
File "/home/travis/miniconda/envs/test/lib/python2.6/unittest.py", line 336, in failUnlessRaises
callableObj(*args, **kwargs)
File "/home/travis/build/blink1073/scikit-image/skimage/morphology/greyreconstruct.py", line 134, in reconstruction
selem = selem.astype(bool, copy=True)
TypeError: astype() takes no keyword arguments
```

Python 2.6 Errors that were not fixed:

```python
======================================================================
ERROR: test_unwrap.test_unwrap_2d(array([[ 0. , 0.6283185307, 1.2566370614, 1.8849555922,
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/tests/test_unwrap.py", line 40, in check_unwrap
image_unwrapped = unwrap_phase(image_wrapped)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/unwrap.py", line 96, in unwrap_phase
wrap_around)
File "_unwrap_2d.pyx", line 9, in skimage.restoration._unwrap_2d.unwrap_2d (skimage/restoration/_unwrap_2d.c:1381)
File "stringsource", line 619, in View.MemoryView.memoryview_cwrapper (skimage/restoration/_unwrap_2d.c:6615)
File "stringsource", line 327, in View.MemoryView.memoryview.__cinit__ (skimage/restoration/_unwrap_2d.c:3385)
TypeError: 'MaskedArray' does not have the buffer interface
-------------------- >> begin captured stdout << ---------------------
Testing a masked image
--------------------- >> end captured stdout << ----------------------
======================================================================
ERROR: test_unwrap.test_unwrap_3d(array([[[ 0. , 0.3141592654, 0.6283185307, ...,
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/tests/test_unwrap.py", line 40, in check_unwrap
image_unwrapped = unwrap_phase(image_wrapped)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/unwrap.py", line 99, in unwrap_phase
wrap_around)
File "_unwrap_3d.pyx", line 9, in skimage.restoration._unwrap_3d.unwrap_3d (skimage/restoration/_unwrap_3d.c:1381)
File "stringsource", line 619, in View.MemoryView.memoryview_cwrapper (skimage/restoration/_unwrap_3d.c:6638)
File "stringsource", line 327, in View.MemoryView.memoryview.__cinit__ (skimage/restoration/_unwrap_3d.c:3408)
TypeError: 'MaskedArray' does not have the buffer interface
-------------------- >> begin captured stdout << ---------------------
Testing a masked image
--------------------- >> end captured stdout << ----------------------
======================================================================
ERROR: test_unwrap.test_mask
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/test/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/tests/test_unwrap.py", line 127, in test_mask
image_unwrapped = unwrap_phase(image_wrapped)
File "/home/travis/build/blink1073/scikit-image/skimage/restoration/unwrap.py", line 96, in unwrap_phase
wrap_around)
File "_unwrap_2d.pyx", line 9, in skimage.restoration._unwrap_2d.unwrap_2d (skimage/restoration/_unwrap_2d.c:1381)
File "stringsource", line 619, in View.MemoryView.memoryview_cwrapper (skimage/restoration/_unwrap_2d.c:6615)
File "stringsource", line 327, in View.MemoryView.memoryview.__cinit__ (skimage/restoration/_unwrap_2d.c:3385)
TypeError: 'MaskedArray' does not have the buffer interface
----------------------------------------------------------------------
```

Cython Error that required Cython >= 0.19:

```python
Traceback (most recent call last):
File "setup.py", line 151, in
cmdclass={'build_py': build_py},
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/core.py", line 152, in setup
config = configuration()
File "setup.py", line 52, in configuration
config.add_subpackage('skimage')
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
caller_level = 2)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
caller_level = caller_level + 1)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "skimage/setup.py", line 16, in configuration
config.add_subpackage('filter')
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
caller_level = 2)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
caller_level = caller_level + 1)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "skimage/filter/setup.py", line 18, in configuration
cython(['rank/generic_cy.pyx'], working_path=base_path)
File "/home/silvester/workspace/scikit-image/skimage/_build.py", line 41, in cython
cythonize(pyxfile)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 603, in cythonize
aliases=aliases)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 546, in create_extension_list
kwds = deps.distutils_info(file, aliases, base).values
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 457, in distutils_info
return (self.transitive_merge(filename, self.distutils_info0, DistutilsInfo.merge)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 467, in transitive_merge
node, extract, merge, seen, {}, self.cimported_files)[0]
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 478, in transitive_merge_helper
for next in outgoing(node):
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Utils.py", line 29, in wrapper
res = cache[args] = f(self, *args)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 406, in cimported_files
pxd_file = self.find_pxd(module, filename)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Utils.py", line 29, in wrapper
res = cache[args] = f(self, *args)
File "/home/silvester/anaconda/envs/py26test/lib/python2.6/site-packages/Cython/Build/Dependencies.py", line 388, in find_pxd
raise NotImplementedError("New relative imports.")
NotImplementedError: New relative imports.
```