From 4500316e6333dfd210c42c86e319802837a2a625 Mon Sep 17 00:00:00 2001 From: happysalada Date: Mon, 24 Jul 2023 23:27:11 +0900 Subject: [PATCH] python310Packages.opentelemetry-instrumentation-grpc: init at 0.39b0 grpc formatting fix --- .../default.nix | 61 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix new file mode 100644 index 000000000000..abeed7f05882 --- /dev/null +++ b/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, hatchling +, opentelemetry-api +, opentelemetry-instrumentation +, opentelemetry-sdk +, opentelemetry-semantic-conventions +, opentelemetry-test-utils +, wrapt +, pytestCheckHook +, grpcio +}: + +buildPythonPackage rec { + pname = "opentelemetry-instrumentation-grpc"; + version = "0.39b0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "open-telemetry"; + repo = "opentelemetry-python-contrib"; + rev = "refs/tags/v${version}"; + hash = "sha256-DkDAE0MsF9HdywxlFzqJaqNor4O/jpnSqINsKTuiVqU="; + sparseCheckout = [ "/instrumentation/${pname}" ]; + } + "/instrumentation/${pname}"; + + format = "pyproject"; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + opentelemetry-api + opentelemetry-instrumentation + opentelemetry-sdk + opentelemetry-semantic-conventions + wrapt + ]; + + passthru.optional-dependencies = { + instruments = [ grpcio ]; + }; + + nativeCheckInputs = [ + opentelemetry-test-utils + grpcio + pytestCheckHook + ]; + + pythonImportsCheck = [ "opentelemetry.instrumentation.grpc" ]; + + meta = with lib; { + homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-grpc"; + description = "OpenTelemetry Instrumentation for grpc"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0465cbe4187e..9474b88f2e57 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7410,6 +7410,8 @@ self: super: with self; { opentelemetry-instrumentation-django = callPackage ../development/python-modules/opentelemetry-instrumentation-django { }; + opentelemetry-instrumentation-grpc = callPackage ../development/python-modules/opentelemetry-instrumentation-grpc { }; + opentelemetry-instrumentation-wsgi = callPackage ../development/python-modules/opentelemetry-instrumentation-wsgi { }; opentelemetry-proto = callPackage ../development/python-modules/opentelemetry-proto { };