1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 gitUpdater,
6 opentelemetry-api,
7 opentelemetry-sdk,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 qcs-api-client-common,
12 quil,
13 rustPlatform,
14 syrupy,
15}:
16
17buildPythonPackage rec {
18 pname = "qcs-sdk-python";
19 version = "0.21.19";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "rigetti";
24 repo = "qcs-sdk-rust";
25 tag = "python/v${version}";
26 hash = "sha256-116+DbsvLBNWjyeGcm3+zrmY9HKWONii2Me0XjEGACo=";
27 };
28
29 cargoDeps = rustPlatform.fetchCargoVendor {
30 inherit pname version src;
31 hash = "sha256-+F7PRBg73GFSeUCmt5NWa+gBhuZU5J7F5TGqRJKqwGc=";
32 };
33
34 buildAndTestSubdir = "crates/python";
35
36 nativeBuildInputs = [
37 rustPlatform.cargoSetupHook
38 rustPlatform.maturinBuildHook
39 ];
40
41 dependencies = [
42 qcs-api-client-common
43 quil
44 ];
45
46 optional-dependencies = {
47 tracing-opentelemetry = [ opentelemetry-api ];
48 };
49
50 nativeCheckInputs = [
51 opentelemetry-sdk
52 pytest-asyncio
53 pytestCheckHook
54 syrupy
55 ];
56
57 disabledTests = [
58 "test_compile_program"
59 "test_conjugate_pauli_by_clifford"
60 "test_execute_qvm"
61 "test_generate_randomized_benchmark_sequence"
62 "test_get_instruction_set_actitecture_public"
63 "test_get_report"
64 "test_get_version_info"
65 "test_list_quantum_processors_timeout"
66 "test_quilc_tracing"
67 "test_qvm_tracing"
68 ];
69
70 passthru.updateScript = gitUpdater {
71 rev-prefix = "python/v";
72 };
73
74 meta = {
75 changelog = "https://github.com/rigetti/qcs-sdk-rust/blob/${src.tag}/crates/python/CHANGELOG.md";
76 description = "Python interface for the QCS Rust SDK";
77 homepage = "https://github.com/rigetti/qcs-sdk-rust/tree/main/crates/python";
78 license = lib.licenses.asl20;
79 maintainers = with lib.maintainers; [ dotlambda ];
80 };
81}