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