-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 support for Python 3.11 (backport #9028) #9071
Conversation
* Add support for Python 3.11 Python 3.11.0 was released on 10-24-2022, this commit marks the start of support for Python 3.11 in qiskit. It adds the supported Python version in the package metadata and updates the CI configuration to run test jobs on Python 3.11 and build Python 3.11 wheels on release. * Fix inspect.Parameter usage for API change in 3.11 Per the Python 3.11.0 release notes inspect.Parameter now raises a ValueError if the name argument is a Python identifier. This was causing a test failure in one case where a parameter named `lambda` was used. This commit adjusts the parameter name in the tests to be lam to avoid this issue. * Set a version cap on the jax dev requirement Currently jax doesn't publish Python 3.11 wheels which is blocking test runs with python 3.11. Since jax is an optional package only used for the gradient package we can just skip it as isn't a full blocker for using python 3.11. This commit sets an environment marker on the jax dev requirements to only try to install it on Python < 3.11. * Set python version cap on cplex in CI * DNM: Test wheel builds work * Skip tests on i686/win32 wheel buids with python 3.11 * Revert "DNM: Test wheel builds work" This reverts commit 725c21b. * Run QPY backwards compat tests on trailing edge Python version This commit moves the qpy backwards compatibility testing from the leading edge python version, which in this PR branch is Python 3.11, to the trailing edge Python version which is currently 3.7. Trying to add support for a new Python version has demonstrated that we can't use the leading edge version as historical versions of Qiskit used to generate old QPY payloads are not going to be generally installable with newer Python versions. So by using the trailing edge version instead we can install all the older versions of Qiskit as there is Python compatibility for those Qiskit versions. Eventually we will need to raise the minimum Qiskit version we use in the QPY tests, when Python 3.9 goes EoL in October 2025 and Qiskit Terra 0.18.0 no longer has any supported versions of Python it was released for. We probably could get by another year until Python 3.10 goes EoL in 2026 it just means we're building 0.18.x and 0.19.x from source for the testing, but when Python 3.11 becomes our oldest supported version we'll likely have to bump the minimum version. This does go a bit counter to the intent of the test matrix to make the first stage return fast and do a more through check in the second stage. But, in this case the extra runtime is worth the longer term stability in the tests. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 75d66dd)
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
The tweedledum package is already treated as optional on the 0.22.x release series and is not required for arm64 macOS systems. Tweedledum doesn't yet support Python 3.11 so this commit restricts it as a requirement for Python 3.11 users.
This is an automatic backport of pull request #9028 done by Mergify.
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refresh
will re-evaluate the rules@Mergifyio rebase
will rebase this PR on its base branch@Mergifyio update
will merge the base branch into this PR@Mergifyio backport <destination>
will backport this PR on<destination>
branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com