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
Add 3.12 to action, but without cython support #2294
Conversation
.github/workflows/tests.yml
Outdated
# Builds without Cython at runtime. This is a core feature; | ||
# everything should be able to run this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update the comment to mention why we have an extra non-Cython run for 3.12.
qutip/__init__.py
Outdated
warnings.warn( | ||
"The new version of Cython, (>= 3.0.0) is not supported." | ||
.format(_Cython.__version__) | ||
) | ||
elif _version2int(_Cython.__version__.split()[0]) >= _version2int("3.12.0"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this elif
condition. We appear to be comparing a Python version to a Cython version?
qutip/tests/conftest.py
Outdated
return | ||
import qutip | ||
if not qutip.settings.has_cython: | ||
pytest.skip("Cython not available at runtime.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit uncomfortable relying on QuTiP's own detection magic to skip tests. If it ends up being wrong in some cases Cython tests will be silently skipped in CI.
Perhaps let's just check against the Python version and skip if it's Python 3.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one more comment, otherwise looks good.
Co-authored-by: Simon Cross <hodgestar+github@gmail.com>
Description
Add python 3.12 to automated test and wheel build.
However python 3.12 removed the
imp
module used bypyximport
.The fix on cython side may only be for cython 3.X, so we run without cython at runtime on 3.12.
Related to #2293