depot/third_party/nixpkgs/pkgs/development/python-modules/opencensus/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

55 lines
1.2 KiB
Nix

{ 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 ];
};
}