Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / opentelemetry-api / default.nix
blob289784d4ac4143c9a62ddb9d2894f9c37c40d380
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , deprecated
6 , hatchling
7 , importlib-metadata
8 , opentelemetry-test-utils
9 , setuptools
10 , pytestCheckHook
11 , pythonRelaxDepsHook
14 let
15   self = buildPythonPackage rec {
16     pname = "opentelemetry-api";
17     version = "1.20.0";
18     disabled = pythonOlder "3.7";
20     # to avoid breakage, every package in opentelemetry-python must inherit this version, src, and meta
21     src = fetchFromGitHub {
22       owner = "open-telemetry";
23       repo = "opentelemetry-python";
24       rev = "refs/tags/v${version}";
25       hash = "sha256-tOg3G6BjHInY5TFYyS7/JA4mQajeP0b1QjrZBGqiqnM=";
26     };
28     sourceRoot = "${src.name}/opentelemetry-api";
30     format = "pyproject";
32     nativeBuildInputs = [
33       hatchling
34       pythonRelaxDepsHook
35     ];
37     propagatedBuildInputs = [
38       deprecated
39       importlib-metadata
40       setuptools
41     ];
43     pythonRelaxDeps = [
44       "importlib-metadata"
45     ];
47     nativeCheckInputs = [
48       opentelemetry-test-utils
49       pytestCheckHook
50     ];
52     pythonImportsCheck = [ "opentelemetry" ];
54     doCheck = false;
56     # Enable tests via passthru to avoid cyclic dependency with opentelemetry-test-utils.
57     passthru.tests.${self.pname} = self.overridePythonAttrs { doCheck = true; };
59     meta = with lib; {
60       homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api";
61       description = "OpenTelemetry Python API";
62       changelog = "https://github.com/open-telemetry/opentelemetry-python/releases/tag/${self.src.rev}";
63       license = licenses.asl20;
64       maintainers = teams.deshaw.members ++ [ maintainers.natsukium ];
65     };
66   };
67 in self