2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pythonOlder,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
arrow,
|
|
|
|
nest-asyncio,
|
|
|
|
qiskit-terra,
|
|
|
|
requests,
|
|
|
|
requests-ntlm,
|
|
|
|
websocket-client,
|
2020-04-24 23:36:52 +00:00
|
|
|
# Visualization inputs
|
2024-06-05 15:53:02 +00:00
|
|
|
withVisualization ? true,
|
|
|
|
ipython,
|
|
|
|
ipyvuetify,
|
|
|
|
ipywidgets,
|
|
|
|
matplotlib,
|
|
|
|
plotly,
|
|
|
|
pyperclip,
|
|
|
|
seaborn,
|
2020-04-24 23:36:52 +00:00
|
|
|
# check inputs
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
nbconvert,
|
|
|
|
nbformat,
|
|
|
|
pproxy,
|
|
|
|
qiskit-aer,
|
|
|
|
websockets,
|
|
|
|
vcrpy,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.20.2";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
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}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-7dIspeJpukLDfICoBPPZZWdzkVumtvh+NRxvtmnvWH0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
arrow
|
|
|
|
nest-asyncio
|
|
|
|
qiskit-terra
|
|
|
|
requests
|
2024-01-25 14:12:00 +00:00
|
|
|
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
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
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 = [
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_coder_operators" # fails for some reason on nixos-21.05+
|
2022-04-27 09:35:20 +00:00
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|