From 9d671e53b43fde27cea40c69b089834cbd8dcb5d Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Wed, 30 Mar 2022 20:54:17 +0100 Subject: [PATCH] Add dummy extra for `CSPLayout` (#7842) * Add dummy extra for `CSPLayout` This currently has no effect, but since we no longer use `CSPLayout` in the preset pass managers, we are moving to demote its dependency `python-constraint` from a requirement to an optional. This is the preliminary step of the process, which allows packages to depend on `qiskit-terra[csp-layout-pass]` before we actually make the switch. * Add redundant requirement rather than TODO Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../notes/csp-layout-extra-b62a5e53f136534a.yaml | 11 +++++++++++ setup.py | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/csp-layout-extra-b62a5e53f136534a.yaml diff --git a/releasenotes/notes/csp-layout-extra-b62a5e53f136534a.yaml b/releasenotes/notes/csp-layout-extra-b62a5e53f136534a.yaml new file mode 100644 index 000000000000..a0863920b33e --- /dev/null +++ b/releasenotes/notes/csp-layout-extra-b62a5e53f136534a.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + A new extra ``csp-layout-pass`` has been added to the install target for + ``pip install qiskit-terra``, and is also included in the ``all`` extra. + This has no effect in Qiskit Terra 0.20, but starting from Qiskit Terra 0.21, + the dependencies needed only for the :class:`.CSPLayout` transpiler pass will + be downgraded from requirements to optionals, and installed by this extra. + You can prepare a package that depends on this pass by setting its + requirements (or ``pip install`` command) to target + ``qiskit-terra[csp-layout-pass]``. diff --git a/setup.py b/setup.py index ff6195e84783..d346360119b9 100755 --- a/setup.py +++ b/setup.py @@ -33,6 +33,9 @@ ) +csplayout_requirements = [ + "python-constraint>=1.4", +] visualization_extras = [ "matplotlib>=3.3", "ipywidgets>=7.3.0", @@ -82,10 +85,11 @@ "visualization": visualization_extras, "bip-mapper": bip_requirements, "crosstalk-pass": z3_requirements, + "csp-layout-pass": csplayout_requirements, # Note: 'all' does not include 'bip-mapper' because cplex is too fiddly and too little # supported on various Python versions and OSes compared to Terra. You have to ask for it # explicitly. - "all": visualization_extras + z3_requirements, + "all": visualization_extras + z3_requirements + csplayout_requirements, }, project_urls={ "Bug Tracker": "https://github.com/Qiskit/qiskit-terra/issues",