CI: py 3.10 build failing
See original GitHub issue@seberg this build is using numpy 1.22dev, looks like a bunch of the failures are raising in np.iinfo(np.int64).max
return np.iinfo(np.int64).max
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[AttributeError("'iinfo' object has no attribute 'kind'") raised in repr()] iinfo object at 0x7f986b9aa830>
int_type = <class 'numpy.int64'>
def __init__(self, int_type):
try:
self.dtype = numeric.dtype(int_type)
except TypeError:
> self.dtype = numeric.dtype(type(int_type))
E TypeError: 'numpy.dtype[bool_]' object is not callable
/opt/hostedtoolcache/Python/3.10.0-beta.2/x64/lib/python3.10/site-packages/numpy/core/getlimits.py:518: TypeError
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:24 (17 by maintainers)
Top Results From Across the Web
Hydra install on python 3.10 fails due to VS build tools
ERROR: Failed building wheel for hydra Running setup.py clean for hydra Successfully built hfcnn Failed to build hydra Installing collected ...
Read more >Changelog — Python 3.11.1 documentation
gh-95243: Mitigate the inherent race condition from using find_unused_port() in testSockName() by trying to find an unused port a few times before failing....
Read more >SciPy disappeared from Python 3.10? - Travis CI Community
Our test build with Python 3.10 (AMD64, Linux, jammy) is now failing, although it was working well two weeks ago, and all builds...
Read more >1948522 – pytest's own tests fail with Python 3.10
pytest fails to build with Python 3.10.0a7. ... SKIPPED [1] testing/test_faulthandler.py:52: sometimes crashes on CI (#7022) ====== 2 failed, 3031 passed, ...
Read more >CircleCI with Python and Django - Earthly Blog
I'm currently working on a project comparing different CI/CD pipelines, ... build-and-push-to-dockerhub: docker: - image: cimg/python:3.10.1 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Aha, I think I have a lead… To cut it down more, this line is sufficient to trigger the issue:
And that should end up side-stepping almost all code in
maybe_convert_objects
.Not feeling like getting pandas dev setup running right now, but there is one line here:
which is called from cython using:
Now, that may be nothing, but
np.full
lives in thenumeric
module. And it does use adtype
which is the booleandtype
we end up with here. Obviously, that also should not mess with the module scope, but at least thenp.core.numeric
module gets involved there.EDIT: Continuing down the rabbit hole a bit. In fact the value is mutated by the time the trace function says that
np.full
is called (or by the time tracing reports it). No call before it seems to happen at all (np.empty
, etc. are all C implemented though, so maybe that is why).EDIT2: I opened a Python issue here: https://bugs.python.org/issue46451
I’ve run into this problem while trying to debug (in PyCharm) some code that uses pandas 1.3.5, and I was able to create a minimal reproducible example:
Note that pandas is changing the value of
numpy.core.numeric.dtype
, which originally is a class:If we comment out
sys.settrace(trace)
and debug the code, the output is a little bit different:If we uncomment
# import scipy.linalg.lapack
, the output is a little bit more complex (the first error I got, and similar to the error in the original report above, and also reported in this question in StackOverflow):Using a custom trace function, I’ve pinpointed that the global
dtype
is changed right after this call: https://github.com/pandas-dev/pandas/blob/v1.3.5/pandas/core/indexes/base.py#L6411This call goes into Cython code and, looking at it, I’ve found this suspicious assignment that may be the cause (but I’m not sure, as there’s also the weird issue that this only happens when there’s a tracer or a profiler): https://github.com/pandas-dev/pandas/blob/v1.3.5/pandas/_libs/lib.pyx#L2655 (also another one here: https://github.com/pandas-dev/pandas/blob/v1.3.5/pandas/_libs/lib.pyx#L1429).
(Also, not sure why would an assignment like that change a global in a
numpy
module, bug in Cython perhaps?)