ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / opencensus / default.nix
blob0690da3d7ba9d6cf189178be2ab192a592409272
1 { buildPythonPackage
2 , fetchPypi
3 , lib
4 , python
5 , unittestCheckHook
6 , google-api-core
7 }:
9 let
10   opencensus-context = buildPythonPackage rec {
11     pname = "opencensus-context";
12     version = "0.1.3";
14     checkInputs = [ unittestCheckHook ];
16     src = fetchPypi {
17       inherit pname version;
18       sha256 = "sha256-oDEIw8ENjIC7Xd9cih8DMWH6YZcqmRf5ubOhhRfwCIw=";
19     };
20   };
22 buildPythonPackage rec {
23   pname = "opencensus";
24   version = "0.11.0";
26   src = fetchPypi {
27     inherit pname version;
28     sha256 = "sha256-AmIWq6uJ2U2FBJLz3GWVAFXsT4QRX6bHvq/7pEo0bkI=";
29   };
31   buildInputs = [
32     # opencensus-context is embedded in opencensus
33     opencensus-context
34   ];
36   propagatedBuildInputs = [
37     google-api-core
38   ];
40   postInstall = ''
41     ln -sf ${opencensus-context}/${python.sitePackages}/opencensus/common/runtime_context \
42       $out/${python.sitePackages}/opencensus/common/
43   '';
45   checkInputs = [ unittestCheckHook ];
47   pythonImportsCheck = [ "opencensus" ];
49   meta = with lib; {
50     description = "A stats collection and distributed tracing framework";
51     homepage = "https://github.com/census-instrumentation/opencensus-python";
52     license = licenses.asl20;
53     maintainers = with maintainers; [ billhuang ];
54   };