From 53bfcf505849affff691d1c4ff311f9ffc8262d0 Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Thu, 8 Oct 2020 01:14:51 -0400 Subject: [PATCH] python3Packages.qiskit-ibmq-provider: disable optional packages by default Disables visualization packages in the user environment by default. Allows running leaner/faster import environments by default. Packages can still be added with override or manually adding to environment. --- .../qiskit-ibmq-provider/default.nix | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix index 9b907711f46..7374d7ce017 100644 --- a/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix +++ b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix @@ -9,21 +9,33 @@ , requests_ntlm , websockets # Visualization inputs -, ipykernel +, withVisualization ? false +, ipython , ipyvuetify , ipywidgets , matplotlib -, nbconvert -, nbformat , plotly , pyperclip , seaborn # check inputs , pytestCheckHook +, nbconvert +, nbformat , pproxy , vcrpy }: +let + visualizationPackages = [ + ipython + ipyvuetify + ipywidgets + matplotlib + plotly + pyperclip + seaborn + ]; +in buildPythonPackage rec { pname = "qiskit-ibmq-provider"; version = "0.11.1"; @@ -44,24 +56,16 @@ buildPythonPackage rec { requests requests_ntlm websockets - # Visualization/Jupyter inputs - ipykernel - ipyvuetify - ipywidgets - matplotlib - nbconvert - nbformat - plotly - pyperclip - seaborn - ]; + ] ++ lib.optionals withVisualization visualizationPackages; # Most tests require credentials to run on IBMQ checkInputs = [ pytestCheckHook + nbconvert + nbformat pproxy vcrpy - ]; + ] ++ lib.optionals (!withVisualization) visualizationPackages; pythonImportsCheck = [ "qiskit.providers.ibmq" ]; # These disabled tests require internet connection, aren't skipped elsewhere