18 buildPythonPackage rec {
20 format = "setuptools";
24 inherit pname version;
25 hash = "sha256-bEVeAI+obZ6anYW7dtpCd8DX2WaKO/pw2+hunzx1mUc=";
28 outputs = [ "out" "dev" ];
30 nativeBuildInputs = [ cython pkg-config ];
32 buildInputs = [ c-ares openssl zlib ];
33 propagatedBuildInputs = [ six protobuf ]
34 ++ lib.optionals (isPy27) [ enum34 futures ];
37 export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="$NIX_BUILD_CORES"
38 if [ -z "$enableParallelBuilding" ]; then
39 GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=1
41 '' + lib.optionalString stdenv.isDarwin ''
45 GRPC_BUILD_WITH_BORING_SSL_ASM = "";
46 GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1;
47 GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1;
48 GRPC_PYTHON_BUILD_SYSTEM_CARES = 1;
50 # does not contain any tests
53 enableParallelBuilding = true;
55 pythonImportsCheck = [ "grpc" ];
58 description = "HTTP/2-based RPC framework";
59 license = licenses.asl20;
60 homepage = "https://grpc.io/grpc/python/";
61 maintainers = with maintainers; [ ];