diff options
author | Drew Risinger <drewrisinger@users.noreply.github.com> | 2020-03-20 10:43:30 -0400 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2020-03-26 10:38:27 -0700 |
commit | 532e0890b4cd6cfe45ffd330fbd86dc19e4dc341 (patch) | |
tree | 5e62111d54212a3ed4025fb7196934d75cb80654 | |
parent | 90dcc3360327e250536eeeca7fe9d887c9f7a817 (diff) |
pythonPackages.qiskit-ibmq-provider: init at 0.4.5
Qiskit Provider for accessing the quantum devices and simulators at IBMQ. Requirement of qiskit package.
-rw-r--r-- | pkgs/development/python-modules/qiskit-ibmq-provider/default.nix | 63 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
2 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix new file mode 100644 index 0000000000000..a9afcff9fea89 --- /dev/null +++ b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix @@ -0,0 +1,63 @@ +{ lib +, pythonOlder +, buildPythonPackage +, fetchFromGitHub +, nest-asyncio +, qiskit-terra +, requests +, requests_ntlm +, websockets + # check inputs +, pytestCheckHook +, vcrpy +, pproxy +}: + +buildPythonPackage rec { + pname = "qiskit-ibmq-provider"; + version = "0.4.5"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "Qiskit"; + repo = pname; + rev = version; + sha256 = "148x3x1gk6l7nrqdllglq6ywh70k4747ybkx0bn25k3gmxd57y03"; + }; + + propagatedBuildInputs = [ + nest-asyncio + qiskit-terra + requests + requests_ntlm + websockets + ]; + + # websockets seems to be pinned b/c in v8+ it drops py3.5 support. Not an issue here (usually py3.7+, and disabled for older py3.6) + prePatch = '' + substituteInPlace requirements.txt --replace "websockets>=7,<8" "websockets" + substituteInPlace setup.py --replace "websockets>=7,<8" "websockets" + ''; + + # Most tests require credentials to run on IBMQ + checkInputs = [ pytestCheckHook vcrpy pproxy ]; + dontUseSetuptoolsCheck = true; + pythonImportsCheck = [ "qiskit.providers.ibmq" ]; + disabledTests = [ "test_old_api_url" "test_non_auth_url" "test_non_auth_url_with_hub" ]; # tests require internet connection + # skip tests that require IBMQ credentials, vs failing. + preCheck = '' + pushd /build/source # run pytest from /build vs $out + substituteInPlace test/decorators.py --replace "Exception('Could not locate valid credentials.')" "SkipTest('No IBMQ Credentials provided for tests')" + ''; + postCheck = '' + popd + ''; + + meta = with lib; { + description = "Qiskit provider for accessing the quantum devices and simulators at IBMQ"; + homepage = "https://github.com/Qiskit/qiskit-ibmq-provider"; + license = licenses.asl20; + maintainers = with maintainers; [ drewrisinger ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8d3505a16869c..d2d63bacc2dbe 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7052,6 +7052,8 @@ in { qiskit = callPackage ../development/python-modules/qiskit { }; + qiskit-ibmq-provider = callPackage ../development/python-modules/qiskit-ibmq-provider { }; + qiskit-terra = callPackage ../development/python-modules/qiskit-terra { }; qasm2image = callPackage ../development/python-modules/qasm2image { }; |