otlp-json 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ on:
3
3
  branches: [main]
4
4
  pull_request:
5
5
  branches: [main]
6
+ workflow_dispatch:
6
7
 
7
8
  jobs:
8
9
  ci:
@@ -10,8 +11,8 @@ jobs:
10
11
  strategy:
11
12
  fail-fast: false
12
13
  matrix:
13
- python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13, 3.13t, 3.14]
14
- dep-versions: [--frozen, "--resolution lowest", "--resolution highest"]
14
+ python-version: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13, 3.13t, 3.14, 3.15, 3.15t]
15
+ dep-versions: [--frozen, "--resolution lowest", "--resolution highest --upgrade"]
15
16
  steps:
16
17
  - uses: actions/checkout@v4
17
18
  - uses: astral-sh/setup-uv@v5
@@ -26,6 +27,7 @@ jobs:
26
27
  uv build
27
28
 
28
29
  release:
30
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
29
31
  needs: ci
30
32
  runs-on: ubuntu-latest
31
33
  environment: release
@@ -35,9 +37,7 @@ jobs:
35
37
  steps:
36
38
  - uses: actions/checkout@v4
37
39
  - uses: astral-sh/setup-uv@v5
38
- - run: |
39
- uv build --sdist --wheel
40
- rm -vf dist/.gitignore # https://github.com/astral-sh/uv/issues/11652
40
+ - run: uv build --sdist --wheel
41
41
  - uses: pypa/gh-action-pypi-publish@release/v1
42
42
  with:
43
43
  repository-url: https://test.pypi.org/legacy/
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: git@github.com:astral-sh/ruff-pre-commit.git
3
- rev: v0.9.6
3
+ rev: v0.11.12
4
4
  hooks:
5
5
  - id: ruff
6
6
  args: [ --fix ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: otlp-json
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: 🐍Lightweight OTEL span to JSON converter, no dependencies, pure Python🐍
5
5
  Project-URL: Repository, https://github.com/dimaqq/otlp-json
6
6
  Project-URL: Issues, https://github.com/dimaqq/otlp-json/issues
@@ -65,13 +65,21 @@ class SomeExporter:
65
65
  - 4KB Python source
66
66
  - ?? metadata
67
67
 
68
- ### TODO(doc)
69
68
 
70
- - link to rust library
71
- - link to urllib sender
72
- - link to test vector generator
69
+ ### Testing
73
70
 
74
- ### TODO(features)
71
+ ```sh
72
+ uv sync
73
+ uv run pytest
74
+ ```
75
+
76
+ ### Links
77
+
78
+ - Test data generator: https://pypi.org/project/otlp-test-data/
79
+ - Python stdlib-only exporter: https://github.com/canonical/operator/blob/main/tracing/ops_tracing/_export.py#L141-L160
80
+ - Tiny (compiled) extension written in Rust: https://pypi.org/project/otlp-proto
81
+
82
+ ### Features
75
83
 
76
84
  - Events
77
85
  - Links
@@ -7,15 +7,15 @@ from typing import Any, TYPE_CHECKING
7
7
  if TYPE_CHECKING:
8
8
  from typing_extensions import TypeAlias
9
9
 
10
- from opentelemetry.trace import Link
11
- from opentelemetry._logs import LogRecord
12
10
  from opentelemetry.sdk.trace import ReadableSpan, Event
13
11
  from opentelemetry.sdk.resources import Resource
14
12
  from opentelemetry.sdk.util.instrumentation import InstrumentationScope
15
13
  from opentelemetry.trace.status import Status
16
14
 
17
15
  _LEAF_VALUE: TypeAlias = "str | int | float | bool" # TODO: confirm
18
- _VALUE: TypeAlias = "_LEAF_VALUE | Sequence[_LEAF_VALUE]"
16
+ _VALUE: TypeAlias = (
17
+ "_LEAF_VALUE | Sequence[_LEAF_VALUE] | Mapping[str, _LEAF_VALUE]"
18
+ )
19
19
 
20
20
 
21
21
  __all__ = [
@@ -79,7 +79,10 @@ def _resource(resource: Resource):
79
79
 
80
80
 
81
81
  def _attributes(
82
- thing: Resource | InstrumentationScope | ReadableSpan | Event | Link | LogRecord,
82
+ thing: Resource
83
+ | InstrumentationScope
84
+ | ReadableSpan
85
+ | Event, # TODO: | Link | LogRecord
83
86
  ) -> dict[str, Any]:
84
87
  rv = {"attributes": [], "dropped_attributes_count": 0}
85
88
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "otlp-json"
3
- version = "1.0.0"
3
+ version = "1.0.1"
4
4
  description = "🐍Lightweight OTEL span to JSON converter, no dependencies, pure Python🐍"
5
5
  requires-python = ">=3.8"
6
6
  license = {text = "Apache License (2.0)"}
@@ -43,8 +43,14 @@ dev = [
43
43
  ]
44
44
  testing = [
45
45
  "pytest ~= 8.3.4",
46
- "otlp-test-data >= 0.9.3",
46
+ "otlp-test-data >= 1.0.2",
47
47
  ]
48
+ [ tool.uv]
49
+ constraint-dependencies = [
50
+ "wrapt ~= 1.14.0; python_version >= '3.11'",
51
+ "protobuf>=6.31.0; python_version >= '3.14'",
52
+ ]
53
+ exclude-dependencies = ["grpcio"]
48
54
 
49
55
  [build-system]
50
56
  requires = ["hatchling"]
@@ -35,13 +35,21 @@ class SomeExporter:
35
35
  - 4KB Python source
36
36
  - ?? metadata
37
37
 
38
- ### TODO(doc)
39
38
 
40
- - link to rust library
41
- - link to urllib sender
42
- - link to test vector generator
39
+ ### Testing
43
40
 
44
- ### TODO(features)
41
+ ```sh
42
+ uv sync
43
+ uv run pytest
44
+ ```
45
+
46
+ ### Links
47
+
48
+ - Test data generator: https://pypi.org/project/otlp-test-data/
49
+ - Python stdlib-only exporter: https://github.com/canonical/operator/blob/main/tracing/ops_tracing/_export.py#L141-L160
50
+ - Tiny (compiled) extension written in Rust: https://pypi.org/project/otlp-proto
51
+
52
+ ### Features
45
53
 
46
54
  - Events
47
55
  - Links