1{
2 buildPythonPackage,
3 cirq-core,
4 freezegun,
5 google-api-core,
6 protobuf,
7 pytestCheckHook,
8 setuptools,
9 protobuf4,
10 fetchpatch,
11}:
12
13buildPythonPackage rec {
14 pname = "cirq-google";
15 pyproject = true;
16 inherit (cirq-core) version src meta;
17
18 sourceRoot = "${src.name}/${pname}";
19
20 build-system = [ setuptools ];
21
22 patches = [
23 # https://github.com/quantumlib/Cirq/pull/6683 Support for protobuf5
24 (fetchpatch {
25 url = "https://github.com/quantumlib/Cirq/commit/bae02e4d83aafa29f50aa52073d86eb913ccb2d3.patch";
26 hash = "sha256-MqHhKa38BTM6viQtWik0TQjN0OPdrwzCZkkqZsiyF5w=";
27 includes = [ "cirq_google/serialization/arg_func_langs_test.py" ];
28 stripLen = 1;
29 })
30 ];
31
32 pythonRelaxDeps = [
33 "protobuf"
34 ];
35
36 dependencies = [
37 cirq-core
38 google-api-core
39 protobuf
40 ] ++ google-api-core.optional-dependencies.grpc;
41
42 nativeCheckInputs = [
43 freezegun
44 pytestCheckHook
45 ];
46
47 disabledTestPaths = [
48 # No need to test the version number
49 "cirq_google/_version_test.py"
50 # Trace/BPT trap: 5
51 "cirq_google/engine/calibration_test.py"
52 # Very time-consuming
53 "cirq_google/engine/*_test.py"
54 ];
55
56 disabledTests = [
57 # unittest.mock.InvalidSpecError: Cannot autospec attr 'QuantumEngineServiceClient'
58 "test_get_engine_sampler_explicit_project_id"
59 "test_get_engine_sampler"
60 # Calibration issue
61 "test_xeb_to_calibration_layer"
62 ];
63}