-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rerun with cython 0.29.35 to fix Python 3.11 compatibility issues #1020
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## devel #1020 +/- ##
=======================================
Coverage 54.49% 54.49%
=======================================
Files 210 210
Lines 21560 21560
Branches 3169 3169
=======================================
Hits 11750 11750
Misses 9255 9255
Partials 555 555 |
@zhenwendai @MartinBubel, you're some of the last commit authors in the history. Any chance we can get this committed and a new version cut soon? There are several projects that rely on it that are currently having issues with recently Python and numpy version mismatches. |
Thanks for picking this up @jeremysanders . @bpkroth I don't have the rights to merge and even though being among the recent contributors, my experience with However, I spend some time with this and did the following:
Running root@ad1ad64679d9:/GPy# pytest .
================================================================== test session starts ==================================================================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /GPy
collected 0 items / 1 error
======================================================================== ERRORS =========================================================================
______________________________________________________ ERROR collecting GPy/testing/linalg_test.py ______________________________________________________
ImportError while importing test module '/GPy/GPy/testing/linalg_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
GPy/__init__.py:32: in <module>
from numpy.testing import Tester
E ImportError: cannot import name 'Tester' from 'numpy.testing' (/usr/local/lib/python3.11/site-packages/numpy/testing/__init__.py)
-------------------------------------------------------------------- Captured stdout --------------------------------------------------------------------
warning in stationary: failed to import cython module: falling back to numpy
warning in coregionalize: failed to import cython module: falling back to numpy
warning in choleskies: failed to import cython module: falling back to numpy
================================================================ short test summary info ================================================================
ERROR GPy/testing/linalg_test.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================== 1 error in 1.55s ==================================================================== I could not immediately figure out what the actual cause of the error is but I would not surprised if this is another "old thing" causing problems nowadays. @jeremysanders what was your approach on testing? Anyways "lgtm". But I think it would be better if one the maintainers can take a look at this. |
I took a brief look at this:
That's basically a shim that numpy was providing for running tests with "nose", which is what GPy still uses. nose is also very out of date and not maintained. I imagine some hacks could be done to support it, but it's more than I have time to dig into atm. |
I can take a look at the tests, but not guarantee that I will get it done in the next couple of days... But imho it would be best to consider this an opportunity and get rid of outdated / deprecated testing envionrments, so my intended fix would be to update the tests (if possible). Doest that sound good for you @bpkroth ? |
Also, I wonder whether we should start a new PR for adding some CI job that builds the cython files for each deploy/release. I don't want to sound too ambitious on this but keeping cython-files in the repo might not be the best idea (as we have seen in the issues leading to this PR). |
I propse that we merge this PR as this point. As mentioned above, I don't like the fact to much that the cython files are in the repo but that seems to be the case for Regarding the test and deploy changes proposed above, I recommend that we start a separate PR to account for them. |
Alternatively, remove the generated C sources. That's what cython people advise now, since they cannot guarantee forward compatibility with python. |
Ok, so this one is indeed a bigger fish than the contributor is frying. Thanks very much everyone for bringing this up, and to the contributor for providing an interim fix. @lawrennd what are your thoughts on the urgency and strategy for (a) removing the generated C (b) digging out of the Unless you've got strong feelings on (c) I think it's better to make the pragmatic decision to support 3.11 as soon as possible. For (a) and (b), I suspect there may be less-than-obvious ramifications. |
My one concern with dropping the generated C code is that it may make |
I'm less familiar with the technical challenges, but I agree with your analysis. It feels like (c) is a priority, and (a) and (b) are also important but may require some thought. I feel a bit too distant from the technical details to be doing the merge, but I've just sent @MartinBubel an invite on that front. |
@ekalosak the discussion here: cython/cython#5089 (comment) |
Ok so it seems like the right path forward is to (a) merge this immediately (b) open a discussion issue for removing the compiled cython from the repo. I'll move my concerns about degrading user build times to that discussion thread. |
This should fix the Python 3.11 compatibility problems by rerunning cython using 0.29.35.
See bugs:
#1018
#998