Merge pull request #231464 from tomaskala/grpc-interceptor-0.15.1
grpc-interceptor: init at 0.15.1
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
, poetry-core
|
||||
, grpcio
|
||||
, protobuf
|
||||
, pytest-asyncio
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "grpc-interceptor";
|
||||
version = "0.15.1";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "d5h-foss";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "md7pwlahF5kiaydLATdW7Yde8iVVcBEjCIGP5qRLwXw=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace "poetry.masonry.api" "poetry.core.masonry.api"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
poetry-core
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
grpcio
|
||||
protobuf
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytest-asyncio
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"grpc_interceptor"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Simplified gRPC interceptors";
|
||||
homepage = "https://github.com/d5h-foss/grpc-interceptor";
|
||||
changelog = "https://github.com/d5h-foss/grpc-interceptor/releases/tag/v${version}";
|
||||
longDescription = ''
|
||||
Simplified Python gRPC interceptors.
|
||||
|
||||
The Python gRPC package provides service interceptors, but they're a bit
|
||||
hard to use because of their flexibility. The gRPC interceptors don't
|
||||
have direct access to the request and response objects, or the service
|
||||
context. Access to these are often desired, to be able to log data in the
|
||||
request or response, or set status codes on the context.
|
||||
'';
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ tomaskala ];
|
||||
};
|
||||
}
|
||||
@@ -4380,6 +4380,8 @@ self: super: with self; {
|
||||
|
||||
grpc-google-iam-v1 = callPackage ../development/python-modules/grpc-google-iam-v1 { };
|
||||
|
||||
grpc-interceptor = callPackage ../development/python-modules/grpc-interceptor { };
|
||||
|
||||
grpcio = callPackage ../development/python-modules/grpcio { };
|
||||
|
||||
grpcio-gcp = callPackage ../development/python-modules/grpcio-gcp { };
|
||||
|
||||
Reference in New Issue
Block a user