Skip to content

Commit 131d5f3

Browse files
committed
Add support for protobuf 5
Signed-off-by: Jason Parraga <[email protected]>
1 parent 187048a commit 131d5f3

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
strategy:
9999
fail-fast: false
100100
matrix:
101-
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "lint", "spellcheck",
101+
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "docker-tests-proto5", "lint", "spellcheck",
102102
"docs", "mypy", "mypyinstalled", "tracecontext"]
103103
name: ${{ matrix.tox-environment }}
104104
runs-on: ubuntu-20.04

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4242
([#3917](https://github.com/open-telemetry/opentelemetry-python/pull/3917/))
4343
- Add OpenTelemetry trove classifiers to PyPI packages
4444
([#3913] (https://github.com/open-telemetry/opentelemetry-python/pull/3913))
45+
- Update proto dependencies to allow protobuf 5
46+
([#3931](https://github.com/open-telemetry/opentelemetry-python/pull/3931))
4547

4648
## Version 1.24.0/0.45b0 (2024-03-28)
4749

opentelemetry-proto/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.11",
2626
]
2727
dependencies = [
28-
"protobuf>=3.19, < 5.0",
28+
"protobuf>=3.19, < 6.0",
2929
]
3030

3131
[project.urls]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
asgiref==3.7.2
2+
attrs==23.2.0
3+
Deprecated==1.2.14
4+
flaky==3.7.0
5+
importlib-metadata==6.11.0
6+
iniconfig==2.0.0
7+
packaging==23.2
8+
pluggy==1.4.0
9+
protobuf==5.27.0
10+
py==1.11.0
11+
py-cpuinfo==9.0.0
12+
pytest==7.1.3
13+
pytest-benchmark==4.0.0
14+
tomli==2.0.1
15+
typing_extensions==4.10.0
16+
wrapt==1.16.0
17+
zipp==3.17.0
18+
-e opentelemetry-proto

tox.ini

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ envlist =
1212
; below mean these dependencies are being used:
1313
; 0: protobuf==3.20.3
1414
; 1: protobuf==4.25.3
15-
py3{8,9,10,11}-opentelemetry-protobuf-{0,1}
16-
pypy3-opentelemetry-protobuf-{0,1}
15+
; 2: protobuf==5.27.0
16+
py3{8,9,10,11}-opentelemetry-protobuf-{0,1,2}
17+
pypy3-opentelemetry-protobuf-{0,1,2}
1718

1819
py3{8,9,10,11}-opentelemetry-sdk
1920
pypy3-opentelemetry-sdk
@@ -86,7 +87,7 @@ envlist =
8687
tracecontext
8788
mypy,mypyinstalled
8889
docs
89-
docker-tests-proto{3,4}
90+
docker-tests-proto{3,4,5}
9091
public-symbols-check
9192

9293
[testenv]
@@ -99,9 +100,10 @@ deps =
99100
coverage: pytest-cov
100101
mypy,mypyinstalled: mypy
101102

102-
; proto 3 and 4 tests install the respective version of protobuf
103+
; proto 3,4, and 5 tests install the respective version of protobuf
103104
proto3: protobuf~=3.19.0
104105
proto4: protobuf~=4.0
106+
proto5: protobuf~=5.26.0
105107

106108

107109
setenv =
@@ -123,6 +125,7 @@ commands_pre =
123125

124126
protobuf-0: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-0.txt
125127
protobuf-1: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-1.txt
128+
protobuf-2: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-2.txt
126129

127130
getting-started: pip install -r {toxinidir}/docs/getting_started/tests/requirements.txt
128131
getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http
@@ -275,7 +278,7 @@ commands_pre =
275278
commands =
276279
{toxinidir}/scripts/tracecontext-integration-test.sh
277280

278-
[testenv:docker-tests-proto{3,4}]
281+
[testenv:docker-tests-proto{3,4,5}]
279282
deps =
280283
pytest==7.1.3
281284
# Pinning PyYAML for issue: https://github.com/yaml/pyyaml/issues/724
@@ -285,9 +288,10 @@ deps =
285288
docker-compose==1.29.2
286289
requests==2.28.2
287290

288-
; proto 3 and 4 tests install the respective version of protobuf
291+
; proto 3, 4 and 5 tests install the respective version of protobuf
289292
proto3: protobuf~=3.19.0
290293
proto4: protobuf~=4.0
294+
proto5: protobuf~=5.26.0
291295

292296
changedir =
293297
tests/opentelemetry-docker-tests/tests
@@ -310,6 +314,8 @@ commands =
310314
proto3: pytest {posargs}
311315
; opencensus exporter does not work with protobuf 4
312316
proto4: pytest --ignore opencensus {posargs}
317+
; opencensus exporter does not work with protobuf 5
318+
proto5: pytest --ignore opencensus {posargs}
313319

314320
commands_post =
315321
docker-compose down -v

0 commit comments

Comments
 (0)