From 83a6844847964ccb879502423be26730a8fe8dd2 Mon Sep 17 00:00:00 2001 From: Semyon Moroz Date: Sat, 21 Jun 2025 17:56:08 +0000 Subject: [PATCH] [opentracing] Add missing stubs (#14274) --- stubs/opentracing/@tests/stubtest_allowlist.txt | 1 + stubs/opentracing/METADATA.toml | 4 ---- stubs/opentracing/opentracing/logs.pyi | 12 +++++++----- stubs/opentracing/opentracing/propagation.pyi | 8 +++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/stubs/opentracing/@tests/stubtest_allowlist.txt b/stubs/opentracing/@tests/stubtest_allowlist.txt index 7c96a3405..9f41ee7c2 100644 --- a/stubs/opentracing/@tests/stubtest_allowlist.txt +++ b/stubs/opentracing/@tests/stubtest_allowlist.txt @@ -1,3 +1,4 @@ +# They raise ModuleNotFoundError so they are not present at stubtest runtime: opentracing.harness.api_check opentracing.harness.scope_check opentracing.scope_managers.gevent diff --git a/stubs/opentracing/METADATA.toml b/stubs/opentracing/METADATA.toml index 70555adff..80a499c5b 100644 --- a/stubs/opentracing/METADATA.toml +++ b/stubs/opentracing/METADATA.toml @@ -1,6 +1,2 @@ version = "2.4.*" upstream_repository = "https://github.com/opentracing/opentracing-python" -partial_stub = true - -[tool.stubtest] -ignore_missing_stub = true diff --git a/stubs/opentracing/opentracing/logs.pyi b/stubs/opentracing/opentracing/logs.pyi index 15cda689b..8aa6c11f3 100644 --- a/stubs/opentracing/opentracing/logs.pyi +++ b/stubs/opentracing/opentracing/logs.pyi @@ -1,5 +1,7 @@ -ERROR_KIND: str -ERROR_OBJECT: str -EVENT: str -MESSAGE: str -STACK: str +from typing import Final + +ERROR_KIND: Final = "error.kind" +ERROR_OBJECT: Final = "error.object" +EVENT: Final = "event" +MESSAGE: Final = "message" +STACK: Final = "stack" diff --git a/stubs/opentracing/opentracing/propagation.pyi b/stubs/opentracing/opentracing/propagation.pyi index 81307c63f..3c9607b8f 100644 --- a/stubs/opentracing/opentracing/propagation.pyi +++ b/stubs/opentracing/opentracing/propagation.pyi @@ -1,8 +1,10 @@ +from typing import Final + class UnsupportedFormatException(Exception): ... class InvalidCarrierException(Exception): ... class SpanContextCorruptedException(Exception): ... class Format: - BINARY: str - TEXT_MAP: str - HTTP_HEADERS: str + BINARY: Final = "binary" + TEXT_MAP: Final = "text_map" + HTTP_HEADERS: Final = "http_headers"