Skip to content

Commit 19c81b7

Browse files
committed
fix(deps): optional typing_extensions for py 3.8
1 parent 8881f62 commit 19c81b7

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

otlp_json.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
from __future__ import annotations
22

33
import json
4-
from typing import Any, Sequence, TypeAlias, TYPE_CHECKING
4+
from typing import Any, Sequence, TYPE_CHECKING
55

66
if TYPE_CHECKING:
7+
from typing_extensions import TypeAlias
8+
79
from opentelemetry.sdk.trace import ReadableSpan
810
from opentelemetry.sdk.resources import Resource
911
from opentelemetry.sdk.util.instrumentation import InstrumentationScope
1012
from opentelemetry.trace.status import Status
1113

14+
_LEAF_VALUE: TypeAlias = str | int | float | bool # TODO: confirm
15+
_VALUE: TypeAlias = _LEAF_VALUE | Sequence[_LEAF_VALUE]
1216

13-
CONTENT_TYPE = "application/json"
1417

15-
_LEAF_VALUE: TypeAlias = str | int | float | bool # TODO: confirm
16-
_VALUE: TypeAlias = _LEAF_VALUE | Sequence[_LEAF_VALUE]
18+
CONTENT_TYPE = "application/json"
1719

1820

1921
def encode_spans(spans: Sequence[ReadableSpan]) -> bytes:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies = []
3333
[dependency-groups]
3434
dev = [
3535
"opentelemetry-api ~= 1.30", # 1.30 fixed type hints for Python 3.8
36+
"typing_extensions ~= 4.12",
3637
"pyright ~= 1.1",
3738
"ruff ~= 0.9",
3839
]

uv.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)