Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make python-constraint optional (Qiskit/qiskit#7733)
* Make python-constraint optional Since Qiskit/qiskit#7213 we no longer have been using the CSPLayout pass by default in the preset passmanagers or transpile(). This is because it has been superseded by the VF2Layout pass which is now used everywhere. While we will keep the CSPLayout pass around for the forseeable future there is no need to install python-constraint by default anymore since it's only user is the CSPLayout pass, which isn't going to be commonly used anymore now that it's not used in the default compilation path anymore. This commit removes the python-constraint library from the requirements list and makes it an optional dependency. Fixes Qiskit/qiskit#7726 * Add docstring for HAS_CONSTRAINT * Add private module to avoid module level optional import This commit splits the custom solver class definition out into a separate private module that is not imported until runtime. This enables us to avoid a module level import for python-constraint meaning we only try to import if something is actually using CSPLayout. * Fix rebase issue * Fix lint * Fix typo in release note Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> * Alphabetize optionals list Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
- Loading branch information