Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow support for protobuf5 #3931

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "lint", "spellcheck",
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "docker-tests-proto5", "lint", "spellcheck",
Sovietaced marked this conversation as resolved.
Show resolved Hide resolved
"docs", "mypy", "mypyinstalled", "tracecontext"]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Update proto dependencies to allow protobuf 5
([#3931](https://github.com/open-telemetry/opentelemetry-python/pull/3931))

## Version 1.25.0/0.46b0 (2024-05-30)

- Fix class BoundedAttributes to have RLock rather than Lock
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
flaky==3.7.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
protobuf==5.26.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e opentelemetry-proto
-e exporter/opentelemetry-exporter-otlp-proto-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
flaky==3.7.0
googleapis-common-protos==1.63.1
grpcio==1.62.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
protobuf==5.26.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e exporter/opentelemetry-exporter-otlp-proto-grpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
asgiref==3.7.2
attrs==23.2.0
certifi==2024.2.2
charset-normalizer==3.3.2
Deprecated==1.2.14
flaky==3.7.0
googleapis-common-protos==1.63.1
idna==3.6
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
protobuf==5.26.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
PyYAML==6.0.1
requests==2.31.0
responses==0.24.1
tomli==2.0.1
typing_extensions==4.10.0
urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e exporter/opentelemetry-exporter-otlp-proto-http
2 changes: 1 addition & 1 deletion opentelemetry-proto/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"protobuf>=3.19, < 5.0",
"protobuf>=3.19, < 6.0",
]

[project.urls]
Expand Down
18 changes: 18 additions & 0 deletions opentelemetry-proto/test-requirements-2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
asgiref==3.7.2
attrs==23.2.0
Deprecated==1.2.14
flaky==3.7.0
importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==23.2
pluggy==1.4.0
protobuf==5.27.0
py==1.11.0
py-cpuinfo==9.0.0
pytest==7.1.3
pytest-benchmark==4.0.0
tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-proto
36 changes: 24 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ envlist =
; below mean these dependencies are being used:
; 0: protobuf==3.20.3
; 1: protobuf==4.25.3
py3{8,9,10,11}-opentelemetry-protobuf-{0,1}
pypy3-opentelemetry-protobuf-{0,1}
; 2: protobuf==5.26.0
py3{8,9,10,11}-opentelemetry-protobuf-{0,1,2}
pypy3-opentelemetry-protobuf-{0,1,2}

py3{8,9,10,11}-opentelemetry-sdk
pypy3-opentelemetry-sdk
Expand All @@ -38,8 +39,9 @@ envlist =
; below mean these dependencies are being used:
; 0: protobuf==3.20.3
; 1: protobuf==4.25.3
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-common-{0,1}
pypy3-opentelemetry-exporter-otlp-proto-common-{0,1}
; 2: protobuf==5.26.0
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-common-{0,1,2}
pypy3-opentelemetry-exporter-otlp-proto-common-{0,1,2}

; opentelemetry-exporter-otlp
py3{8,9,10,11}-opentelemetry-exporter-otlp-combined
Expand All @@ -49,15 +51,17 @@ envlist =
; below mean these dependencies are being used:
; 0: protobuf==3.20.3
; 1: protobuf==4.25.3
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-grpc-{0,1}
; 2: protobuf==5.26.0
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-grpc-{0,1,2}
; intentionally excluded from pypy3

; The numbers at the end of the environment names
; below mean these dependencies are being used:
; 0: protobuf==3.20.3
; 1: protobuf==4.25.3
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-http-{0,1}
pypy3-opentelemetry-exporter-otlp-proto-http-{0,1}
; 2: protobuf==5.26.0
py3{8,9,10,11}-opentelemetry-exporter-otlp-proto-http-{0,1,2}
pypy3-opentelemetry-exporter-otlp-proto-http-{0,1,2}

py3{8,9,10,11}-opentelemetry-exporter-prometheus
pypy3-opentelemetry-exporter-prometheus
Expand Down Expand Up @@ -86,7 +90,7 @@ envlist =
tracecontext
mypy,mypyinstalled
docs
docker-tests-proto{3,4}
docker-tests-proto{3,4,5}
public-symbols-check

[testenv]
Expand All @@ -99,9 +103,10 @@ deps =
coverage: pytest-cov
mypy,mypyinstalled: mypy

; proto 3 and 4 tests install the respective version of protobuf
; proto 3,4, and 5 tests install the respective version of protobuf
proto3: protobuf~=3.19.0
proto4: protobuf~=4.0
proto5: protobuf~=5.26.0


setenv =
Expand All @@ -123,6 +128,7 @@ commands_pre =

protobuf-0: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-0.txt
protobuf-1: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-1.txt
protobuf-2: pip install -r {toxinidir}/opentelemetry-proto/test-requirements-2.txt

getting-started: pip install -r {toxinidir}/docs/getting_started/tests/requirements.txt
getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http
Expand All @@ -135,14 +141,17 @@ commands_pre =

exporter-otlp-proto-common-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt
exporter-otlp-proto-common-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt
exporter-otlp-proto-common-2: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-2.txt

exporter-otlp-combined: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp/test-requirements.txt

opentelemetry-exporter-otlp-proto-grpc-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt
opentelemetry-exporter-otlp-proto-grpc-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt
opentelemetry-exporter-otlp-proto-grpc-2: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-2.txt

opentelemetry-exporter-otlp-proto-http-0: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt
opentelemetry-exporter-otlp-proto-http-1: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt
opentelemetry-exporter-otlp-proto-http-2: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-2.txt

opentracing-shim: pip install -r {toxinidir}/shim/opentelemetry-opentracing-shim/test-requirements.txt

Expand Down Expand Up @@ -275,7 +284,7 @@ commands_pre =
commands =
{toxinidir}/scripts/tracecontext-integration-test.sh

[testenv:docker-tests-proto{3,4}]
[testenv:docker-tests-proto{3,4,5}]
deps =
pytest==7.1.3
# Pinning PyYAML for issue: https://github.com/yaml/pyyaml/issues/724
Expand All @@ -285,9 +294,10 @@ deps =
docker-compose==1.29.2
requests==2.28.2

; proto 3 and 4 tests install the respective version of protobuf
; proto 3, 4 and 5 tests install the respective version of protobuf
proto3: protobuf~=3.19.0
proto4: protobuf~=4.0
proto5: protobuf~=5.26.0
Sovietaced marked this conversation as resolved.
Show resolved Hide resolved

changedir =
tests/opentelemetry-docker-tests/tests
Expand All @@ -298,7 +308,7 @@ commands_pre =
-e {toxinidir}/opentelemetry-semantic-conventions \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/tests/opentelemetry-test-utils \
; opencensus exporter does not work with protobuf 4
; opencensus exporter does not work with protobuf 4 and protobuf 5
proto3: -e {toxinidir}/exporter/opentelemetry-exporter-opencensus \
-e {toxinidir}/opentelemetry-proto \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common \
Expand All @@ -310,6 +320,8 @@ commands =
proto3: pytest {posargs}
; opencensus exporter does not work with protobuf 4
proto4: pytest --ignore opencensus {posargs}
; opencensus exporter does not work with protobuf 5
proto5: pytest --ignore opencensus {posargs}

commands_post =
docker-compose down -v
Expand Down