2021-12-06 16:07:01 +00:00
|
|
|
{ buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, cirq-core
|
|
|
|
, google-api-core
|
|
|
|
, protobuf
|
|
|
|
, pytestCheckHook
|
|
|
|
, freezegun
|
2023-10-19 13:55:26 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cirq-google";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit (cirq-core) version src meta;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/${pname}";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-08-27 14:25:00 +00:00
|
|
|
substituteInPlace requirements.txt \
|
2022-10-21 18:38:19 +00:00
|
|
|
--replace "google-api-core[grpc] >= 1.14.0, < 2.0.0dev" "google-api-core[grpc] >= 1.14.0, < 3.0.0dev" \
|
|
|
|
--replace "protobuf >= 3.15.0, < 4" "protobuf >= 3.15.0"
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cirq-core
|
|
|
|
google-api-core
|
|
|
|
protobuf
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ google-api-core.optional-dependencies.grpc;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-10-28 06:52:43 +00:00
|
|
|
freezegun
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# No need to test the version number
|
|
|
|
"cirq_google/_version_test.py"
|
2023-04-29 16:46:19 +00:00
|
|
|
# Trace/BPT trap: 5
|
|
|
|
"cirq_google/engine/calibration_test.py"
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabledTests = [
|
|
|
|
# unittest.mock.InvalidSpecError: Cannot autospec attr 'QuantumEngineServiceClient'
|
|
|
|
"test_get_engine_sampler_explicit_project_id"
|
|
|
|
"test_get_engine_sampler"
|
2023-10-19 13:55:26 +00:00
|
|
|
# Calibration issue
|
|
|
|
"test_xeb_to_calibration_layer"
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
}
|