1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 poetry-core, 7 grpcio, 8 protobuf, 9 pytest-asyncio, 10 pytestCheckHook, 11}: 12 13buildPythonPackage rec { 14 pname = "grpc-interceptor"; 15 version = "0.15.4"; 16 pyproject = true; 17 18 disabled = pythonOlder "3.7"; 19 20 src = fetchFromGitHub { 21 owner = "d5h-foss"; 22 repo = "grpc-interceptor"; 23 tag = "v${version}"; 24 hash = "sha256-GJkVCslPXShJNDrqhFtCsAK5+VaG8qFJo0RQTsiMIFY="; 25 }; 26 27 nativeBuildInputs = [ poetry-core ]; 28 29 propagatedBuildInputs = [ 30 grpcio 31 protobuf 32 ]; 33 34 __darwinAllowLocalNetworking = true; 35 36 nativeCheckInputs = [ 37 pytest-asyncio 38 pytestCheckHook 39 ]; 40 41 pythonImportsCheck = [ "grpc_interceptor" ]; 42 43 meta = with lib; { 44 description = "Simplified gRPC interceptors"; 45 homepage = "https://github.com/d5h-foss/grpc-interceptor"; 46 changelog = "https://github.com/d5h-foss/grpc-interceptor/releases/tag/v${version}"; 47 longDescription = '' 48 Simplified Python gRPC interceptors. 49 50 The Python gRPC package provides service interceptors, but they're a bit 51 hard to use because of their flexibility. The gRPC interceptors don't 52 have direct access to the request and response objects, or the service 53 context. Access to these are often desired, to be able to log data in the 54 request or response, or set status codes on the context. 55 ''; 56 license = licenses.mit; 57 maintainers = with maintainers; [ tomaskala ]; 58 }; 59}