1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytest-asyncio,
7 pytestCheckHook,
8 pythonOlder,
9 quil,
10 rustPlatform,
11 darwin,
12 libiconv,
13 syrupy,
14}:
15
16buildPythonPackage rec {
17 pname = "qcs-sdk-python";
18 version = "0.17.4";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "rigetti";
25 repo = "qcs-sdk-rust";
26 rev = "python/v${version}";
27 hash = "sha256-Z/NK+xnugFieJqAbvGaVvxUaz9RC1vpWb4ydZTVbZeU=";
28 };
29
30 cargoDeps = rustPlatform.importCargoLock {
31 lockFile = ./Cargo.lock;
32 outputHashes = {
33 "quil-rs-0.23.0" = "sha256-l9wj1j7PJ5L497dPlkEpJ4ctAfjUIada5Vbn2h5ioVE=";
34 };
35 };
36
37 buildAndTestSubdir = "crates/python";
38
39 build-system = [
40 rustPlatform.cargoSetupHook
41 rustPlatform.maturinBuildHook
42 ];
43
44 dependencies = [ quil ];
45
46 buildInputs = lib.optionals stdenv.isDarwin [
47 darwin.apple_sdk.frameworks.Security
48 darwin.apple_sdk.frameworks.SystemConfiguration
49 libiconv
50 ];
51
52 nativeCheckInputs = [
53 pytest-asyncio
54 pytestCheckHook
55 syrupy
56 ];
57
58 disabledTests = [
59 "test_compile_program"
60 "test_conjugate_pauli_by_clifford"
61 "test_execute_qvm"
62 "test_generate_randomized_benchmark_sequence"
63 "test_get_report"
64 "test_get_version_info"
65 "test_list_quantum_processors_timeout"
66 ];
67
68 meta = {
69 changelog = "https://github.com/rigetti/qcs-sdk-rust/blob/${src.rev}/crates/python/CHANGELOG.md";
70 description = "Python interface for the QCS Rust SDK";
71 homepage = "https://github.com/rigetti/qcs-sdk-rust/tree/main/crates/python";
72 license = lib.licenses.asl20;
73 maintainers = with lib.maintainers; [ dotlambda ];
74 };
75}