1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
deprecated,
hatchling,
importlib-metadata,
opentelemetry-test-utils,
setuptools,
pytestCheckHook,
pythonRelaxDepsHook,
writeScript,
}:
let
self = buildPythonPackage rec {
pname = "opentelemetry-api";
version = "1.24.0";
pyproject = true;
disabled = pythonOlder "3.8";
# to avoid breakage, every package in opentelemetry-python must inherit this version, src, and meta
src = fetchFromGitHub {
owner = "open-telemetry";
repo = "opentelemetry-python";
rev = "refs/tags/v${version}";
hash = "sha256-id5cwNl2idgZa1AFfolzEo5vzspv3V2c1Vtzg3EWDZs=";
};
sourceRoot = "${src.name}/opentelemetry-api";
nativeBuildInputs = [ pythonRelaxDepsHook ];
build-system = [ hatchling ];
dependencies = [
deprecated
importlib-metadata
];
pythonRelaxDeps = [ "importlib-metadata" ];
nativeCheckInputs = [
opentelemetry-test-utils
pytestCheckHook
];
pythonImportsCheck = [ "opentelemetry" ];
doCheck = false;
passthru = {
updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-update
set -eu -o pipefail
nix-update --version-regex 'v(.*)' python3Packages.opentelemetry-api
nix-update python3Packages.opentelemetry-instrumentation
'';
# Enable tests via passthru to avoid cyclic dependency with opentelemetry-test-utils.
tests.${self.pname} = self.overridePythonAttrs { doCheck = true; };
};
meta = with lib; {
homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api";
description = "OpenTelemetry Python API";
changelog = "https://github.com/open-telemetry/opentelemetry-python/releases/tag/${self.src.rev}";
license = licenses.asl20;
maintainers = teams.deshaw.members ++ [ maintainers.natsukium ];
};
};
in
self
|