2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
deprecated,
|
|
|
|
hatchling,
|
|
|
|
importlib-metadata,
|
|
|
|
opentelemetry-test-utils,
|
|
|
|
setuptools,
|
|
|
|
pytestCheckHook,
|
|
|
|
writeScript,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-08-22 20:05:09 +00:00
|
|
|
self = buildPythonPackage rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "opentelemetry-api";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.25.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
# to avoid breakage, every package in opentelemetry-python must inherit this version, src, and meta
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-telemetry";
|
|
|
|
repo = "opentelemetry-python";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-9mxgPYliGkNsZGOhF9YCmxZjP3hc2UUmxSpWY4IMLCo=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
sourceRoot = "${src.name}/opentelemetry-api";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ hatchling ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
dependencies = [
|
2023-07-15 17:15:38 +00:00
|
|
|
deprecated
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "importlib-metadata" ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
opentelemetry-test-utils
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "opentelemetry" ];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
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; };
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-api";
|
2023-07-15 17:15:38 +00:00
|
|
|
description = "OpenTelemetry Python API";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/open-telemetry/opentelemetry-python/releases/tag/${self.src.rev}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = teams.deshaw.members ++ [ maintainers.natsukium ];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
in
|
|
|
|
self
|