Closed t-imamichi closed 3 months ago
Totals | |
---|---|
Change from base Build 7982775151: | 0.0% |
Covered Lines: | 4511 |
Relevant Lines: | 4849 |
Works as intended - on 3.12
, cplex
is not installed. On 3.10
, all is good. However, shouldn't we either write this down either in the README or, even better, give a warning to users of Python 3.12.
As it is now, the package happily installs (without cplex
) but then gives the same error as in #577.
One idea would be, e.g., to guard the cplex imports with a warning if users are on 3.12
(as long as there is no updated cplex
package).
If cplex does not exists, we already display a warning message with @_optionals.HAS_CPLEX
. It might be nice to elaborate the message to mention that cplex is not available for python 3.12 at this moment.
https://github.com/qiskit-community/qiskit-optimization/blob/36ad1a13984403e77a5308fc38d61ee1a1a1637d/qiskit_optimization/algorithms/cplex_optimizer.py#L28-L29
Arguably qiskit-optimization does not support 3.12 yet. Qiskit 0.45.1 added 3.12 support. I added support to qiskit algorithms qiskit-community/qiskit-algorithms#108 such that when this is released the apps, like Optimization here, could be updated to inlcude 3.12 as well.
It might make more sense to do this in a PR which adds 3.12 support and CI jobs etc. once algorithms is released. And then do an update (bug fix) release.
Yes, it makes sense to include this PR's change as part of a separate PR to add support for Python 3.12.
@woodsp-ibm I added Python 3.12 support and CI (only Ubuntu + 3.12 due to lack of cplex). Could you take a look at it?
As we are adding 3.12 to the list of supported versions in setup can we add a reno like I did in ML for the 3.12 support, see qiskit-community/qiskit-machine-learning#774 (its the same basic text as what I did in Nature and Algorithms for the same thing!)
Thanks. I added reno.
Summary
Closes #590
Add Python 3.12 support. But since CPLEX does not support Python 3.12 (see pypi), we need to add constraint to 'cplex' extra dependency. Windows and mac are still tested with Python 3.11 because cplex are not available for 3.12.
Fixes #577
Details and comments
Latest cplex 22.1.1.1![image](https://github.com/qiskit-community/qiskit-optimization/assets/31178928/017bcecd-34e1-4c25-88d8-67e9f62166a7)