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-01-13 20:06:32 +00:00
|
|
|
version = "0.20.9";
|
|
|
|
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";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-bQ+5TZzjxGnNRsENEW/sN7sF6SOcgWl4MFtLekD0D+8=";
|
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";
|
|
|
|
sha256 = "sha256-mOc+Q/5cmwPziojtxeEMWWHSDvqvzZlNRbPtOSeTinQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
"tests/test_client/test_client.py"
|
|
|
|
];
|
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";
|
|
|
|
homepage = "https://pypi.org/project/qcs-api-client/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|