From c6ea35d599496060ac3f523cf50b3e9630c1f0da Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Fri, 10 Apr 2020 09:09:27 -0400 Subject: [PATCH] python3Packages.qiskit-terra: 0.12.0 -> 0.13.0 Also add in optional visualization inputs as default to ensure that they are in the environment when used at runtime. Some hacks to avoid packaging retworkx (uses a semi-complicated Rust -> Python packaging system, will try to get that packaged in future). For now, just disabling retworkx, will need to package it in future. --- .../python-modules/qiskit-terra/default.nix | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/qiskit-terra/default.nix b/pkgs/development/python-modules/qiskit-terra/default.nix index 4a015e15d5d6..14497b20b0d0 100644 --- a/pkgs/development/python-modules/qiskit-terra/default.nix +++ b/pkgs/development/python-modules/qiskit-terra/default.nix @@ -2,35 +2,41 @@ , pythonOlder , buildPythonPackage , fetchFromGitHub + # Python requirements , cython , dill +, fastjsonschema , jsonschema , numpy , marshmallow , marshmallow-polyfield -, matplotlib , networkx , ply , psutil +, python-constraint +, retworkx , scipy , sympy + # Python visualization requirements, semi-optional +, ipywidgets +, matplotlib +, pillow +, pydot +, pygments +, pylatexenc +, seaborn # test requirements , ddt , hypothesis -, ipywidgets , nbformat , nbconvert -, pillow -, pydot -, python -, pygraphviz -, pylatexenc , pytestCheckHook +, python }: buildPythonPackage rec { pname = "qiskit-terra"; - version = "0.12.0"; + version = "0.13.0"; disabled = pythonOlder "3.5"; @@ -38,13 +44,14 @@ buildPythonPackage rec { owner = "Qiskit"; repo = pname; rev = version; - sha256 = "1yarfziy2w8n1d7zyyxykfs68608j8md4kwfyhbyc6wy483fk9sy"; + sha256 = "03fgqmyahgmkf5dbw19n9c1v8p4kmpk50wxhhc8435cclvs26x9j"; }; nativeBuildInputs = [ cython ]; propagatedBuildInputs = [ dill + fastjsonschema jsonschema numpy marshmallow @@ -53,34 +60,41 @@ buildPythonPackage rec { networkx ply psutil + python-constraint + retworkx scipy sympy + # Optional/visualization inputs + ipywidgets + matplotlib + pillow + pydot + pygments + pylatexenc + seaborn ]; + postPatch = '' + # Fix relative imports in tests + touch test/python/dagcircuit/__init__.py + ''; # *** Tests *** checkInputs = [ ddt hypothesis - ipywidgets nbformat nbconvert - pillow - pydot - pygraphviz - pylatexenc pytestCheckHook ]; + dontUseSetuptoolsCheck = true; # can't find setup.py, so fails. tested by pytest pythonImportsCheck = [ "qiskit" "qiskit.transpiler.passes.routing.cython.stochastic_swap.swap_trial" ]; - dontUseSetuptoolsCheck = true; # can't find setup.py, so fails. tested by pytest - disabledTests = [ - "test_long_name" # generated circuit images differ for some reason "test_jupyter_jobs_pbars" # needs IBMQ provider package (qiskit-ibmq-provider), circular dependency ]; @@ -112,7 +126,8 @@ buildPythonPackage rec { longDescription = '' Allows the user to write quantum circuits easily, and takes care of the constraints of real hardware. ''; - homepage = "https://github.com/QISKit/qiskit-terra"; + homepage = "https://qiskit.org/terra"; + downloadPage = "https://github.com/QISKit/qiskit-terra/releases"; license = licenses.asl20; maintainers = with maintainers; [ drewrisinger ]; };