2021-09-18 20:21:18 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, importlib-metadata
|
|
|
|
, ipython
|
2022-01-18 09:26:20 +00:00
|
|
|
, lark
|
2021-09-18 20:21:18 +00:00
|
|
|
, networkx
|
|
|
|
, numpy
|
|
|
|
, poetry-core
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-freezegun
|
|
|
|
, pytest-httpx
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, qcs-api-client
|
|
|
|
, retry
|
2021-10-29 20:22:13 +00:00
|
|
|
, respx
|
2021-09-18 20:21:18 +00:00
|
|
|
, rpcq
|
|
|
|
, scipy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyquil";
|
2022-02-15 18:01:28 +00:00
|
|
|
version = "3.1.0";
|
2021-09-18 20:21:18 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rigetti";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-15 18:01:28 +00:00
|
|
|
sha256 = "sha256-ejfzxCf2NucK/hfzswHu3h4DPPZQY8vkMAQ51XDRWKU=";
|
2021-09-18 20:21:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-01-18 09:26:20 +00:00
|
|
|
lark
|
2021-09-18 20:21:18 +00:00
|
|
|
networkx
|
|
|
|
numpy
|
|
|
|
qcs-api-client
|
|
|
|
retry
|
|
|
|
rpcq
|
|
|
|
scipy
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-freezegun
|
|
|
|
pytest-httpx
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
2021-10-29 20:22:13 +00:00
|
|
|
respx
|
2021-09-18 20:21:18 +00:00
|
|
|
ipython
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2022-01-18 09:26:20 +00:00
|
|
|
--replace 'lark = "^0.11.1"' 'lark = "*"'
|
2021-09-18 20:21:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require network access
|
|
|
|
"test/e2e/"
|
|
|
|
"test/unit/test_api.py"
|
2021-10-29 20:22:13 +00:00
|
|
|
"test/unit/test_engagement_manager.py"
|
2021-09-18 20:21:18 +00:00
|
|
|
"test/unit/test_operator_estimation.py"
|
|
|
|
"test/unit/test_wavefunction_simulator.py"
|
|
|
|
"test/unit/test_compatibility_v2_operator_estimation.py"
|
|
|
|
"test/unit/test_compatibility_v2_quantum_computer.py"
|
|
|
|
"test/unit/test_compatibility_v2_qvm.py"
|
|
|
|
"test/unit/test_quantum_computer.py"
|
|
|
|
"test/unit/test_qvm.py"
|
|
|
|
"test/unit/test_reference_wavefunction.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_compile_with_quilt_calibrations"
|
|
|
|
"test_sets_timeout_on_requests"
|
2022-02-07 18:57:57 +00:00
|
|
|
# sensitive to lark parser output
|
|
|
|
"test_memory_commands"
|
|
|
|
"test_classical"
|
2021-09-18 20:21:18 +00:00
|
|
|
];
|
|
|
|
|
2022-02-15 18:01:28 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyquil"
|
|
|
|
];
|
2021-09-18 20:21:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for creating Quantum Instruction Language (Quil) programs";
|
|
|
|
homepage = "https://github.com/rigetti/pyquil";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|