depot/third_party/nixpkgs/pkgs/development/python-modules/qcs-api-client-common/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

77 lines
1.6 KiB
Nix

{
buildPythonPackage,
cargo,
fetchFromGitHub,
grpc-interceptor,
grpcio,
httpx,
lib,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
rustc,
rustPlatform,
syrupy,
}:
buildPythonPackage rec {
pname = "qcs-api-client-common";
version = "0.10.2";
pyproject = true;
src = fetchFromGitHub {
owner = "rigetti";
repo = "qcs-api-client-rust";
rev = "refs/tags/common/v${version}";
hash = "sha256-WXTqzdbBZmBj/+mVK/watOuaq/WqKtaMVhp+ogjmhqM=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"hyper-proxy-0.9.1" = "sha256-P9/qMHfq56rkQoBQF3o/SmbOfcePcFf8yh1YQve3oGM=";
};
};
# FIXME use
# buildAndTestSubdir = "qcs-api-client-common";
# instead, which makes the tests fail
postPatch = ''
cd qcs-api-client-common
'';
cargoRoot = "..";
build-system = [ rustPlatform.maturinBuildHook ];
nativeBuildInputs = [
cargo
rustPlatform.cargoSetupHook
rustc
];
dependencies = [
grpc-interceptor
grpcio
httpx
];
preCheck = ''
# import from $out
rm -r qcs_api_client_common
'';
nativeCheckInputs = [
pytest-asyncio
pytest-mock
pytestCheckHook
syrupy
];
meta = {
changelog = "https://github.com/rigetti/qcs-api-client-rust/blob/${src.rev}/qcs-api-client-common/CHANGELOG-py.md";
description = "Contains core QCS client functionality and middleware implementations";
homepage = "https://github.com/rigetti/qcs-api-client-rust/tree/main/qcs-api-client-common";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dotlambda ];
};
}