From e7e35987a6c88af794f5453b4f980b29988c4ac4 Mon Sep 17 00:00:00 2001 From: Luke Zhang Date: Mon, 27 Oct 2025 09:41:37 -0700 Subject: [PATCH 1/3] Fix: Unable to run ADOT Python unit tests with latest Tox release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tox 3.27.1 was released on November 14, 2022 — before Python 3.12 (October 2023) and Python 3.13 (October 2024) — and does not officially support either version. This PR resolves the blocking issue caused by using the latest Tox release. Changes: - Updated tox.ini to pass valid VCS requirement strings to pip and avoid shell/INI parsing issues. - Removed stray spaces before '@' in pip VCS requirement specifiers. - Removed unnecessary wrapping quotes so strings are not passed with quote characters. - Escaped the '#' in INI fragments to ensure the tox/INI parser preserves pip fragments (e.g., `#egg=...`). Tested with: ```bash python -m venv .venv source .venv/bin/activate pip install tox tox -e lint tox -e spellcheck tox -e 3.9-test-aws-opentelemetry-distro tox -e 3.10-test-aws-opentelemetry-distro tox -e 3.11-test-aws-opentelemetry-distro tox -e 3.12-test-aws-opentelemetry-distro tox -e 3.13-test-aws-opentelemetry-distro ``` --- .github/actions/set_up/action.yml | 8 ++++++-- tox.ini | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/actions/set_up/action.yml b/.github/actions/set_up/action.yml index 433367f95..c41bda160 100644 --- a/.github/actions/set_up/action.yml +++ b/.github/actions/set_up/action.yml @@ -27,7 +27,8 @@ runs: - name: Install tox shell: bash - run: pip install tox==3.27.1 tox-factor + run: | + pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs @@ -41,4 +42,7 @@ runs: - name: Run unit tests/benchmarks with tox if: ${{ inputs.run_unit_tests == 'true' }} shell: bash - run: tox -f ${{ inputs.python_version }}-${{ inputs.package_name }} -- -ra + run: | + ENV_NAME="${{ inputs.python_version }}-test-${{ inputs.package_name }}" + echo "Running tox env: $ENV_NAME" + tox -e "$ENV_NAME" -- -ra diff --git a/tox.ini b/tox.ini index 720de7c4d..ad09263cc 100644 --- a/tox.ini +++ b/tox.ini @@ -35,11 +35,11 @@ commands_pre = ; cases but it saves a lot of boilerplate in this file. test: pip install botocore test: pip install gevent - test: pip install "opentelemetry-api[test] @ {env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - test: pip install "opentelemetry-sdk[test] @ {env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" - test: pip install "opentelemetry-instrumentation[test] @ {env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation" - test: pip install "opentelemetry-exporter-otlp[test] @ {env:CORE_REPO}#egg=opentelemetry-exporter-otlp&subdirectory=exporter/opentelemetry-exporter-otlp" - test: pip install "opentelemetry-test-utils @ {env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" + test: pip install opentelemetry-api[test]@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + test: pip install opentelemetry-sdk[test]@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + test: pip install opentelemetry-instrumentation[test]@{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation + test: pip install opentelemetry-exporter-otlp[test]@{env:CORE_REPO}\#egg=opentelemetry-exporter-otlp&subdirectory=exporter/opentelemetry-exporter-otlp + test: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils aws-opentelemetry-distro: pip install {toxinidir}/aws-opentelemetry-distro commands = From 71fc07e414127e76d175595ef8c73342162c7d75 Mon Sep 17 00:00:00 2001 From: Luke Zhang Date: Mon, 27 Oct 2025 14:37:40 -0700 Subject: [PATCH 2/3] add change log. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f98dd45c..d404fdbf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,3 +17,5 @@ If your change does not need a CHANGELOG entry, add the "skip changelog" label t ([#497](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/497)) - Fix timeout handling for exceeded deadline in retry logic in OTLPAwsLogsExporter ([#501](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/501)) +- Fix: Unable to run ADOT Python unit tests with latest Tox release + ([#521](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/521)) From 83a9599cafc1c0c7be16208109425feff1c91ee5 Mon Sep 17 00:00:00 2001 From: Luke Zhang Date: Mon, 27 Oct 2025 15:30:41 -0700 Subject: [PATCH 3/3] address code review feedback. --- .github/actions/set_up/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/set_up/action.yml b/.github/actions/set_up/action.yml index c41bda160..b11c98fef 100644 --- a/.github/actions/set_up/action.yml +++ b/.github/actions/set_up/action.yml @@ -28,7 +28,7 @@ runs: - name: Install tox shell: bash run: | - pip install tox + pip install tox==4.30.3 - name: Cache tox environment # Preserves .tox directory between runs for faster installs