Skip to content

lookfor is broken with cython == 0.29.0 #3475

@hmaarrfk

Description

@hmaarrfk

Description

lookfor seems to be broken on travis.
See failures on PR #3472

I can reproduce this on my machine with pip. Seems to be potentially related to Cython

@jni found

 $ pytest --pdb --doctest-modules skimage/util/lookfor.py 
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.6.3, pytest-3.5.1, py-1.5.3, pluggy-0.6.0
rootdir: /home/jni/projects/scikit-image/skimage, inifile:
plugins: cov-2.5.1, hypothesis-3.56.9
collected 1 item                                                                                                                                                                                                                                             

skimage/util/lookfor.py F
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
007 
008     Parameters
009     ----------
010     what : str
011         Words to look for.
012 
013     Examples
014     --------
015     >>> import skimage
016     >>> skimage.lookfor('regular_grid')
UNEXPECTED EXCEPTION: TypeError("'NoneType' object is not iterable",)
Traceback (most recent call last):

  File "/home/jni/miniconda3/envs/cf/lib/python3.6/doctest.py", line 1330, in __run
    compileflags, 1), test.globs)

  File "<doctest skimage.util.lookfor.lookfor[1]>", line 1, in <module>

  File "/home/jni/projects/scikit-image/skimage/util/lookfor.py", line 24, in lookfor
    return np.lookfor(what, sys.modules[__name__.split('.')[0]])

  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/numpy/lib/utils.py", line 754, in lookfor
    cache = _lookfor_generate_cache(module, import_modules, regenerate)

  File "/home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/numpy/lib/utils.py", line 906, in _lookfor_generate_cache
    for pth in item.__path__:

TypeError: 'NoneType' object is not iterable

/home/jni/projects/scikit-image/skimage/util/lookfor.py:16: UnexpectedException
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /home/jni/miniconda3/envs/cf/lib/python3.6/site-packages/numpy/lib/utils.py(906)_lookfor_generate_cache()
-> for pth in item.__path__:
(Pdb) p item
<module 'skimage._shared.geometry' from '/home/jni/projects/scikit-image/skimage/_shared/geometry.cpython-36m-x86_64-linux-gnu.so'>
(Pdb) p item.__dir__()
['__name__', '__doc__', '__package__', '__loader__', '__spec__', '__file__', '__path__', '__builtins__', '__pyx_capi__', '__test__']
(Pdb) item.__file__
'/home/jni/projects/scikit-image/skimage/_shared/geometry.cpython-36m-x86_64-linux-gnu.so'
(Pdb) list
901  	            except AttributeError:
902  	                _all = None
903  	
904  	            # import sub-packages
905  	            if import_modules and hasattr(item, '__path__'):
906  ->	                for pth in item.__path__:
907  	                    for mod_path in os.listdir(pth):
908  	                        this_py = os.path.join(pth, mod_path)
909  	                        init_py = os.path.join(pth, mod_path, '__init__.py')
910  	                        if (os.path.isfile(this_py) and
911  	                                mod_path.endswith('.py')):

## TODO

  • Remove version constraint in requirements/build.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔍 MonitorDepends on an external condition(s); monitor it

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions