1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 httpx,
8 iso8601,
9 poetry-core,
10 pydantic,
11 pydantic-settings,
12 pyjwt,
13 pytest-asyncio,
14 pytestCheckHook,
15 python-dateutil,
16 pythonAtLeast,
17 pythonOlder,
18 tenacity,
19 respx,
20 retrying,
21 rfc3339,
22 toml,
23}:
24
25buildPythonPackage rec {
26 pname = "qcs-api-client";
27 version = "0.26.5";
28 pyproject = true;
29
30 disabled = pythonOlder "3.8";
31
32 src = fetchFromGitHub {
33 owner = "rigetti";
34 repo = "qcs-api-client-python";
35 tag = "v${version}";
36 hash = "sha256-8ZD/vqWA1QnEQXz6P/+NIxe0go1Q/XQ3iRNL/TkoTmM=";
37 };
38
39 patches = [
40 # Switch to poetry-core, https://github.com/rigetti/qcs-api-client-python/pull/2
41 (fetchpatch {
42 name = "switch-to-poetry-core.patch";
43 url = "https://github.com/rigetti/qcs-api-client-python/commit/32f0b3c7070a65f4edf5b2552648d88435469e44.patch";
44 hash = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ=";
45 })
46 ];
47
48 pythonRelaxDeps = [
49 "attrs"
50 "httpx"
51 "iso8601"
52 "pydantic"
53 "tenacity"
54 ];
55
56 build-system = [ poetry-core ];
57
58 dependencies = [
59 attrs
60 httpx
61 iso8601
62 pydantic
63 pydantic-settings
64 pyjwt
65 python-dateutil
66 retrying
67 rfc3339
68 tenacity
69 toml
70 ];
71
72 nativeCheckInputs = [
73 pytest-asyncio
74 pytestCheckHook
75 respx
76 ];
77
78 # Tests are failing on Python 3.11, Fatal Python error: Aborted
79 doCheck = !(pythonAtLeast "3.11");
80
81 pythonImportsCheck = [ "qcs_api_client" ];
82
83 meta = with lib; {
84 description = "Python library for accessing the Rigetti QCS API";
85 homepage = "https://qcs-api-client-python.readthedocs.io/";
86 changelog = "https://github.com/rigetti/qcs-api-client-python/releases/tag/${src.tag}";
87 license = licenses.asl20;
88 maintainers = with maintainers; [ fab ];
89 };
90}