1{ buildPythonPackage
2, cirq-core
3, google-api-core
4, protobuf
5, pytestCheckHook
6, freezegun
7, pythonRelaxDepsHook
8}:
9
10buildPythonPackage rec {
11 pname = "cirq-google";
12 inherit (cirq-core) version src meta;
13
14 sourceRoot = "${src.name}/${pname}";
15
16 postPatch = ''
17 substituteInPlace requirements.txt \
18 --replace "google-api-core[grpc] >= 1.14.0, < 2.0.0dev" "google-api-core[grpc] >= 1.14.0, < 3.0.0dev" \
19 --replace "protobuf >= 3.15.0, < 4" "protobuf >= 3.15.0"
20 '';
21
22 nativeBuildInputs = [
23 pythonRelaxDepsHook
24 ];
25
26 propagatedBuildInputs = [
27 cirq-core
28 google-api-core
29 protobuf
30 ] ++ google-api-core.optional-dependencies.grpc;
31
32 nativeCheckInputs = [
33 freezegun
34 pytestCheckHook
35 ];
36
37 disabledTestPaths = [
38 # No need to test the version number
39 "cirq_google/_version_test.py"
40 # Trace/BPT trap: 5
41 "cirq_google/engine/calibration_test.py"
42 ];
43
44 disabledTests = [
45 # unittest.mock.InvalidSpecError: Cannot autospec attr 'QuantumEngineServiceClient'
46 "test_get_engine_sampler_explicit_project_id"
47 "test_get_engine_sampler"
48 # Calibration issue
49 "test_xeb_to_calibration_layer"
50 ];
51
52}