You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pypy3.9 -Werror -c "import numpy"
numpy/__init__.py:152: in <module>
from . import random
numpy/random/__init__.py:180: in <module>
from . import _pickle
numpy/random/_pickle.py:1: in <module>
from .mtrand import RandomState
numpy/random/mtrand.pyx:19: in init numpy.random.mtrand
???
E ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
The code imports another cython c-extension module from inside a cython c-extension module.
Code to reproduce the behaviour:
The exception points to this
from ._mt19937 import MT19937 as _MT19937
Expected behaviour
Without -Werror the import works, so it is "just" the warning that is problematic.
OS
Ubuntu 22.04
Python version
pypy3.10 (pre-release), pypy3.9
Cython version
from 0.29.31 to HEAD
Additional context
Maybe need to extend #4764 to more cases? I think this might have to do with the CYTHON_PEP489_MULTI_PHASE_INIT=0 for PyPy. If I define it to 1 the warning goes away and NumPy tests pass. I couldn't easily grep for an existing test for importing another module within a module, but there must be one.
The text was updated successfully, but these errors were encountered:
Describe the bug
The code imports another cython c-extension module from inside a cython c-extension module.
Code to reproduce the behaviour:
The exception points to this
Expected behaviour
Without
-Werror
the import works, so it is "just" the warning that is problematic.OS
Ubuntu 22.04
Python version
pypy3.10 (pre-release), pypy3.9
Cython version
from 0.29.31 to HEAD
Additional context
Maybe need to extend #4764 to more cases? I think this might have to do with the
CYTHON_PEP489_MULTI_PHASE_INIT=0
for PyPy. If I define it to1
the warning goes away and NumPy tests pass. I couldn't easily grep for an existing test for importing another module within a module, but there must be one.The text was updated successfully, but these errors were encountered: