Skip to content

opentelemetry-test-utils: move requirements environment markers to a constraint file#5178

Draft
xrmx wants to merge 4 commits intoopen-telemetry:mainfrom
xrmx:fix-dependabot-test-utils
Draft

opentelemetry-test-utils: move requirements environment markers to a constraint file#5178
xrmx wants to merge 4 commits intoopen-telemetry:mainfrom
xrmx:fix-dependabot-test-utils

Conversation

@xrmx
Copy link
Copy Markdown
Contributor

@xrmx xrmx commented May 5, 2026

Description

For some reason dependabot fails parsing them, refer to https://github.com/open-telemetry/opentelemetry-python/actions/runs/25368454713/job/74385376366.

Thanks @emdneto for the tip.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

…constraint file

For some reason dependabot fails parsing them.
@xrmx xrmx requested a review from a team as a code owner May 5, 2026 13:48
@xrmx xrmx marked this pull request as draft May 5, 2026 13:50
@xrmx
Copy link
Copy Markdown
Contributor Author

xrmx commented May 5, 2026

This does not seem to work, locally I have:

diff --git a/tests/opentelemetry-test-utils/test-requirements-constraints.txt b/tests/opentelemetry-test-utils/test-requirements-constraints.txt
new file mode 100644
index 000000000..5501c80e5
--- /dev/null
+++ b/tests/opentelemetry-test-utils/test-requirements-constraints.txt
@@ -0,0 +1,5 @@
+# these are required for weaver integration tests, we're running that only on linux / CPython
+# because of lack of support for gRPC on Windows in some cases.
+./opentelemetry-proto ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./exporter/opentelemetry-exporter-otlp-proto-common ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./exporter/opentelemetry-exporter-otlp-proto-grpc ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
diff --git a/tests/opentelemetry-test-utils/test-requirements.txt b/tests/opentelemetry-test-utils/test-requirements.txt
index 6b4dbcec0..7c066ea39 100644
--- a/tests/opentelemetry-test-utils/test-requirements.txt
+++ b/tests/opentelemetry-test-utils/test-requirements.txt
@@ -13,9 +13,6 @@ zipp==3.19.2
 -e opentelemetry-sdk
 -e opentelemetry-semantic-conventions
 -e tests/opentelemetry-test-utils
-# these are required for weaver integration tests, we're running that only on linux / CPython
-# because of lack of support for gRPC on Windows in some cases.
-# note: tox does not support PEP 508 markers on `-e` editable installs, so these are installed non-editable
-./opentelemetry-proto ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
-./exporter/opentelemetry-exporter-otlp-proto-common ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
-./exporter/opentelemetry-exporter-otlp-proto-grpc ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./opentelemetry-proto
+./exporter/opentelemetry-exporter-otlp-proto-common
+./exporter/opentelemetry-exporter-otlp-proto-grpc
diff --git a/tox.ini b/tox.ini
index d1c5aff8c..4fcbebba9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -123,6 +123,7 @@ deps =
   semantic-conventions: -r {toxinidir}/opentelemetry-semantic-conventions/test-requirements.txt
 
   test-utils: -r {toxinidir}/tests/opentelemetry-test-utils/test-requirements.txt
+  test-utils: -c {toxinidir}/tests/opentelemetry-test-utils/test-requirements-constraints.txt
 
   opentelemetry-proto-gen-oldest: -r {toxinidir}/opentelemetry-proto/test-requirements.oldest.txt
   opentelemetry-proto-gen-latest: -r {toxinidir}/opentelemetry-proto/test-requirements.latest.txt

and I get

py310-test-opentelemetry-test-utils: install_deps> .tox/.tox/bin/uv pip install -r /home/rm/src/opentelemetry-python/tests/opentelemetry-test-utils/test-requirements.txt -c /home/rm/src/opentelemetry-python/tests/opentelemetry-test-utils/test-requirements-constraints.txt
error: Unnamed requirements are not allowed as constraints (found: `file:///home/rm/src/opentelemetry-python/opentelemetry-proto ; platform_python_implementation != 'PyPy' and sys_platform != 'win32'`)

Comment thread tests/opentelemetry-test-utils/test-requirements-constraints.txt Outdated
Comment thread tests/opentelemetry-test-utils/test-requirements.txt Outdated
Comment thread tox.ini Outdated
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Comment thread tox.ini Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants