BUG, TST: fix f2py for PyPy, skip one test for PyPy#15750
BUG, TST: fix f2py for PyPy, skip one test for PyPy#15750mattip merged 5 commits intonumpy:masterfrom
Conversation
numpy/f2py/cfuncs.py
Outdated
There was a problem hiding this comment.
For other reviewers: this is used again on https://github.com/numpy/numpy/pull/15750/files#diff-57556f4d2e5b2a68017772da1827d14cR1100, although I don't really understand what's going on there.
There was a problem hiding this comment.
that link seems to point here?
There was a problem hiding this comment.
GitHub bug. It points to line 1100, but only if it's already expanded
There was a problem hiding this comment.
I think the intention is to reduce the argument count by 1 for methods, but rather than check "isinstance(method)" the check is "not a function". Since CFunctions (builtin functions) are not functions, but also do not have co_argcount on CPython, it works for CPython but fails for PyPy.
There was a problem hiding this comment.
If you've managed to work out what this create_cb_arglist function even does, can you add a comment on line 1034?
In the long run, it seems much of this could be resolved by just calling inspect.signature, either directly or within numpy.core._internal.py.
There was a problem hiding this comment.
Adding a comment to the best of my understanding.
There was a problem hiding this comment.
If you have an understanding of what any of the arguments mean, that would be great in a comment too.
There was a problem hiding this comment.
I don't really understand the code. It seems to have grown organically as a set of patches over the years, each time fixing one thing with no comments.
There was a problem hiding this comment.
Fair enough, let's leave this comment as is.
numpy/lib/tests/test_io.py
Outdated
| @pytest.mark.skipif(IS_PYPY, | ||
| reason="GC problems after test, even after multiple gc.collect calls") |
There was a problem hiding this comment.
Is this worth filing as an issue either in the pypy tracker or the numpy one, and then including the issue id in this reason?
Various changes to make
-mfulltests pass on PyPyin f2py, callback argument count was off for
PyCFunction_Checkwith anco_argcountattribute. CPython does not have the attribute, PyPy does.skip a test on PyPy that allocates
>6GBmemory, somehow it is not collected even with agc.collectremove the
slowmarker from some of thef2pytests, I don't think they are that slow.skip tests for
tp_docon PyPy