2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, arrow
|
|
|
|
, nest-asyncio
|
|
|
|
, qiskit-terra
|
|
|
|
, requests
|
|
|
|
, requests_ntlm
|
2021-12-06 16:07:01 +00:00
|
|
|
, websocket-client
|
2020-04-24 23:36:52 +00:00
|
|
|
# Visualization inputs
|
2021-12-06 16:07:01 +00:00
|
|
|
, withVisualization ? true
|
2020-12-03 08:41:04 +00:00
|
|
|
, ipython
|
2020-04-24 23:36:52 +00:00
|
|
|
, ipyvuetify
|
|
|
|
, ipywidgets
|
|
|
|
, matplotlib
|
|
|
|
, plotly
|
|
|
|
, pyperclip
|
|
|
|
, seaborn
|
|
|
|
# check inputs
|
|
|
|
, pytestCheckHook
|
2020-12-03 08:41:04 +00:00
|
|
|
, nbconvert
|
|
|
|
, nbformat
|
2020-04-24 23:36:52 +00:00
|
|
|
, pproxy
|
2021-03-09 03:18:52 +00:00
|
|
|
, qiskit-aer
|
2021-12-06 16:07:01 +00:00
|
|
|
, websockets
|
2020-04-24 23:36:52 +00:00
|
|
|
, vcrpy
|
|
|
|
}:
|
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
let
|
|
|
|
visualizationPackages = [
|
|
|
|
ipython
|
|
|
|
ipyvuetify
|
|
|
|
ipywidgets
|
|
|
|
matplotlib
|
|
|
|
plotly
|
|
|
|
pyperclip
|
|
|
|
seaborn
|
|
|
|
];
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qiskit-ibmq-provider";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.19.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qiskit";
|
|
|
|
repo = pname;
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "sha256-VdGdaOxCwD2Qa0JCCDVZJtcjhmTssS/KgpcjoaPXYB8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
arrow
|
|
|
|
nest-asyncio
|
|
|
|
qiskit-terra
|
|
|
|
requests
|
|
|
|
requests_ntlm
|
2021-12-06 16:07:01 +00:00
|
|
|
websocket-client
|
2022-04-27 09:35:20 +00:00
|
|
|
websockets
|
2020-12-03 08:41:04 +00:00
|
|
|
] ++ lib.optionals withVisualization visualizationPackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace "websocket-client>=1.0.1" "websocket-client"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Most tests require credentials to run on IBMQ
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-12-03 08:41:04 +00:00
|
|
|
nbconvert
|
|
|
|
nbformat
|
2020-04-24 23:36:52 +00:00
|
|
|
pproxy
|
2021-03-09 03:18:52 +00:00
|
|
|
qiskit-aer
|
2020-04-24 23:36:52 +00:00
|
|
|
vcrpy
|
2020-12-03 08:41:04 +00:00
|
|
|
] ++ lib.optionals (!withVisualization) visualizationPackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "qiskit.providers.ibmq" ];
|
|
|
|
disabledTests = [
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_coder_operators" # fails for some reason on nixos-21.05+
|
|
|
|
# These disabled tests require internet connection, aren't skipped elsewhere
|
2020-04-24 23:36:52 +00:00
|
|
|
"test_old_api_url"
|
|
|
|
"test_non_auth_url"
|
|
|
|
"test_non_auth_url_with_hub"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_coder_optimizers" # TODO: reenable when package scikit-quant is packaged, either in NUR or nixpkgs
|
2020-12-03 08:41:04 +00:00
|
|
|
|
|
|
|
# slow tests
|
|
|
|
"test_websocket_retry_failure"
|
|
|
|
"test_invalid_url"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Skip tests that rely on internet access (mostly to IBM Quantum Experience cloud).
|
|
|
|
# Options defined in qiskit.terra.test.testing_options.py::get_test_options
|
2021-06-04 09:07:49 +00:00
|
|
|
preCheck = ''
|
|
|
|
export QISKIT_TESTS=skip_online
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Qiskit provider for accessing the quantum devices and simulators at IBMQ";
|
|
|
|
homepage = "https://github.com/Qiskit/qiskit-ibmq-provider";
|
2020-09-25 04:45:31 +00:00
|
|
|
changelog = "https://qiskit.org/documentation/release_notes.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ drewrisinger ];
|
|
|
|
};
|
|
|
|
}
|