From e48936d8c46e572bfe7e238efcb6268c7e8d3d2a Mon Sep 17 00:00:00 2001 From: Bill Huang Date: Tue, 4 Oct 2022 15:19:19 +0800 Subject: [PATCH] opencensus: init at 0.11.0 update hash use python.sitePackage add pythonImportsCheck --- .../python-modules/opencensus/default.nix | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/opencensus/default.nix diff --git a/pkgs/development/python-modules/opencensus/default.nix b/pkgs/development/python-modules/opencensus/default.nix new file mode 100644 index 000000000000..0690da3d7ba9 --- /dev/null +++ b/pkgs/development/python-modules/opencensus/default.nix @@ -0,0 +1,55 @@ +{ buildPythonPackage +, fetchPypi +, lib +, python +, unittestCheckHook +, google-api-core +}: + +let + opencensus-context = buildPythonPackage rec { + pname = "opencensus-context"; + version = "0.1.3"; + + checkInputs = [ unittestCheckHook ]; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-oDEIw8ENjIC7Xd9cih8DMWH6YZcqmRf5ubOhhRfwCIw="; + }; + }; +in +buildPythonPackage rec { + pname = "opencensus"; + version = "0.11.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-AmIWq6uJ2U2FBJLz3GWVAFXsT4QRX6bHvq/7pEo0bkI="; + }; + + buildInputs = [ + # opencensus-context is embedded in opencensus + opencensus-context + ]; + + propagatedBuildInputs = [ + google-api-core + ]; + + postInstall = '' + ln -sf ${opencensus-context}/${python.sitePackages}/opencensus/common/runtime_context \ + $out/${python.sitePackages}/opencensus/common/ + ''; + + checkInputs = [ unittestCheckHook ]; + + pythonImportsCheck = [ "opencensus" ]; + + meta = with lib; { + description = "A stats collection and distributed tracing framework"; + homepage = "https://github.com/census-instrumentation/opencensus-python"; + license = licenses.asl20; + maintainers = with maintainers; [ billhuang ]; + }; +}