1{ lib 2, attrs 3, buildPythonPackage 4, fetchFromGitHub 5, fetchpatch 6, httpx 7, iso8601 8, poetry-core 9, pydantic 10, pyjwt 11, pytest-asyncio 12, pytestCheckHook 13, python-dateutil 14, pythonAtLeast 15, pythonOlder 16, pythonRelaxDepsHook 17, respx 18, retrying 19, rfc3339 20, toml 21}: 22 23buildPythonPackage rec { 24 pname = "qcs-api-client"; 25 version = "0.23.1"; 26 format = "pyproject"; 27 28 disabled = pythonOlder "3.7"; 29 30 src = fetchFromGitHub { 31 owner = "rigetti"; 32 repo = "qcs-api-client-python"; 33 rev = "refs/tags/v${version}"; 34 hash = "sha256-Z+RCjpSpfYU3oU5HQ8CzZfwqUjMHvCKVn+p2tq+VDxQ="; 35 }; 36 37 patches = [ 38 # Switch to poetry-core, https://github.com/rigetti/qcs-api-client-python/pull/2 39 (fetchpatch { 40 name = "switch-to-poetry-core.patch"; 41 url = "https://github.com/rigetti/qcs-api-client-python/commit/32f0b3c7070a65f4edf5b2552648d88435469e44.patch"; 42 hash = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ="; 43 }) 44 ]; 45 46 pythonRelaxDeps = [ 47 "attrs" 48 "httpx" 49 ]; 50 51 nativeBuildInputs = [ 52 poetry-core 53 pythonRelaxDepsHook 54 ]; 55 56 propagatedBuildInputs = [ 57 attrs 58 httpx 59 iso8601 60 pydantic 61 pyjwt 62 python-dateutil 63 retrying 64 rfc3339 65 toml 66 ]; 67 68 nativeCheckInputs = [ 69 pytest-asyncio 70 pytestCheckHook 71 respx 72 ]; 73 74 # Tests are failing on Python 3.11, Fatal Python error: Aborted 75 doCheck = !(pythonAtLeast "3.11"); 76 77 pythonImportsCheck = [ 78 "qcs_api_client" 79 ]; 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}