git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.qiskit-ibmq-provider: init at 0.4.5

Qiskit Provider for accessing the quantum devices and simulators at IBMQ. Requirement of qiskit package.

commit532e0890b4cd6cfe45ffd330fbd86dc19e4dc341 authorDrew Risinger <drewrisinger@users.noreply.github.com> dateFri 20 Mar 2020, 10:43 (7 years ago) parent90dcc33
2 files changed+65
pkgs/development/python-modules/qiskit-ibmq-provider/default.nix+63 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/qiskit-ibmq-provider/default.nixnew file+63
@@ -0,0 +1,63 @@
1+{ lib
2+, pythonOlder
3+, buildPythonPackage
4+, fetchFromGitHub
5+, nest-asyncio
6+, qiskit-terra
7+, requests
8+, requests_ntlm
9+, websockets
10+ # check inputs
11+, pytestCheckHook
12+, vcrpy
13+, pproxy
14+}:
15+
16+buildPythonPackage rec {
17+ pname = "qiskit-ibmq-provider";
18+ version = "0.4.5";
19+
20+ disabled = pythonOlder "3.6";
21+
22+ src = fetchFromGitHub {
23+ owner = "Qiskit";
24+ repo = pname;
25+ rev = version;
26+ sha256 = "148x3x1gk6l7nrqdllglq6ywh70k4747ybkx0bn25k3gmxd57y03";
27+ };
28+
29+ propagatedBuildInputs = [
30+ nest-asyncio
31+ qiskit-terra
32+ requests
33+ requests_ntlm
34+ websockets
35+ ];
36+
37+ # 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)
38+ prePatch = ''
39+ substituteInPlace requirements.txt --replace "websockets>=7,<8" "websockets"
40+ substituteInPlace setup.py --replace "websockets>=7,<8" "websockets"
41+ '';
42+
43+ # Most tests require credentials to run on IBMQ
44+ checkInputs = [ pytestCheckHook vcrpy pproxy ];
45+ dontUseSetuptoolsCheck = true;
46+ pythonImportsCheck = [ "qiskit.providers.ibmq" ];
47+ disabledTests = [ "test_old_api_url" "test_non_auth_url" "test_non_auth_url_with_hub" ]; # tests require internet connection
48+ # skip tests that require IBMQ credentials, vs failing.
49+ preCheck = ''
50+ pushd /build/source # run pytest from /build vs $out
51+ substituteInPlace test/decorators.py --replace "Exception('Could not locate valid credentials.')" "SkipTest('No IBMQ Credentials provided for tests')"
52+ '';
53+ postCheck = ''
54+ popd
55+ '';
56+
57+ meta = with lib; {
58+ description = "Qiskit provider for accessing the quantum devices and simulators at IBMQ";
59+ homepage = "https://github.com/Qiskit/qiskit-ibmq-provider";
60+ license = licenses.asl20;
61+ maintainers = with maintainers; [ drewrisinger ];
62+ };
63+}
pkgs/top-level/python-packages.nix+2
@@ -7052,6 +7052,8 @@ in {
70527052
70537053 qiskit = callPackage ../development/python-modules/qiskit { };
70547054
7055+ qiskit-ibmq-provider = callPackage ../development/python-modules/qiskit-ibmq-provider { };
7056+
70557057 qiskit-terra = callPackage ../development/python-modules/qiskit-terra { };
70567058
70577059 qasm2image = callPackage ../development/python-modules/qasm2image { };