2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, attrs
|
|
|
|
, buildPythonPackage
|
2022-01-13 20:06:32 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2021-10-28 06:52:43 +00:00
|
|
|
, httpx
|
|
|
|
, iso8601
|
2022-01-13 20:06:32 +00:00
|
|
|
, poetry-core
|
2021-10-28 06:52:43 +00:00
|
|
|
, pydantic
|
|
|
|
, pyjwt
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
|
|
|
, pythonOlder
|
|
|
|
, respx
|
|
|
|
, retrying
|
|
|
|
, rfc3339
|
|
|
|
, toml
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qcs-api-client";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "0.21.2";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "pyproject";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rigetti";
|
|
|
|
repo = "qcs-api-client-python";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-10-06 18:32:54 +00:00
|
|
|
hash = "sha256-gQow1bNRPhUm4zRu2T5FpcgOTcS2F1TQIz8WP1K0Xww=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
httpx
|
|
|
|
iso8601
|
|
|
|
pydantic
|
|
|
|
pyjwt
|
|
|
|
python-dateutil
|
|
|
|
retrying
|
|
|
|
rfc3339
|
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
patches = [
|
|
|
|
# Switch to poetry-core, https://github.com/rigetti/qcs-api-client-python/pull/2
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/rigetti/qcs-api-client-python/commit/32f0b3c7070a65f4edf5b2552648d88435469e44.patch";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ=";
|
2022-01-13 20:06:32 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
postPatch = ''
|
2022-01-13 20:06:32 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'attrs = "^20.1.0"' 'attrs = "*"' \
|
|
|
|
--replace 'httpx = "^0.15.0"' 'httpx = "*"' \
|
|
|
|
--replace 'iso8601 = "^0.1.13"' 'iso8601 = "*"' \
|
|
|
|
--replace 'pydantic = "^1.7.2"' 'pydantic = "*"' \
|
|
|
|
--replace 'pyjwt = "^1.7.1"' 'pyjwt = "*"'
|
2021-10-28 06:52:43 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Test is outdated
|
2022-06-16 17:23:12 +00:00
|
|
|
"tests/test_client/test_additional_properties.py"
|
|
|
|
"tests/test_client/test_auth.py"
|
2022-01-13 20:06:32 +00:00
|
|
|
"tests/test_client/test_client.py"
|
2022-06-16 17:23:12 +00:00
|
|
|
"tests/test_client/test_datetime.py"
|
|
|
|
"tests/test_imports.py"
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"qcs_api_client"
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for accessing the Rigetti QCS API";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://qcs-api-client-python.readthedocs.io/";
|
2021-10-28 06:52:43 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|