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