-
Notifications
You must be signed in to change notification settings - Fork 621
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
Changes from 1 commit
d629ee1
9183a94
271b347
e1e50df
6fdcc5d
37a6f44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,24 +54,30 @@ | |
pass | ||
else: | ||
from qutip.utilities import _version2int | ||
import sys | ||
_cy_require = "0.29.20" | ||
_cy_unsupported = "3.0.0" | ||
if _version2int(_Cython.__version__) < _version2int(_cy_require): | ||
warnings.warn( | ||
"Old version of Cython detected: needed {}, got {}." | ||
.format(_cy_require, _Cython.__version__) | ||
) | ||
if _version2int(_Cython.__version__) >= _version2int(_cy_unsupported): | ||
elif _version2int(_Cython.__version__) >= _version2int(_cy_unsupported): | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand this |
||
warnings.warn( | ||
"Runtime cython compilation does not work on Python 3.12." | ||
) | ||
else: | ||
# Setup pyximport | ||
import qutip.cy.pyxbuilder as _pyxbuilder | ||
_pyxbuilder.install() | ||
del _pyxbuilder, _Cython, _version2int | ||
qutip.settings.has_cython = True | ||
del sys | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,10 @@ def _skip_cython_tests_if_unavailable(item): | |
# importorskip does not have maxversion | ||
if _version2int(_Cython.__version__) >= _version2int("3.0.0"): | ||
pytest.skip("cython 3.0.0 not supported") | ||
return | ||
import qutip | ||
Ericgig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 commentThe 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? |
||
|
||
|
||
@pytest.hookimpl(trylast=True) | ||
|
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.