From 26c297c3967cbd462f4bf7c459063c6e715a1f29 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 10:48:47 +0100 Subject: [PATCH 01/14] Upgrade tox --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/public-api-check.yml | 2 +- .github/workflows/test.yml | 6 +++--- CONTRIBUTING.md | 6 ++---- tox.ini | 25 ++++++++++++++----------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 1036cb75400..5ac893cfae0 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -25,7 +25,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox==3.27.1 -U tox-factor + run: pip install tox -U tox-factor - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 diff --git a/.github/workflows/public-api-check.yml b/.github/workflows/public-api-check.yml index 46432af0b54..1304b9e23f7 100644 --- a/.github/workflows/public-api-check.yml +++ b/.github/workflows/public-api-check.yml @@ -34,7 +34,7 @@ jobs: python-version: '3.10' - name: Install tox - run: pip install tox==3.27.1 -U tox-factor + run: pip install tox -U tox-factor - name: Public API Check run: tox -e public-symbols-check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15565160154..4f1733c199e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox==3.27.1 -U tox-factor + run: pip install tox -U tox-factor - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 @@ -100,7 +100,7 @@ jobs: python-version: '3.10' architecture: 'x64' - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 @@ -191,7 +191,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox==3.27.1 -U tox-factor + run: pip install tox -U tox-factor - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 344b5585853..485cb6a0fcc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,14 +38,12 @@ during their normal contribution hours. This project uses [tox](https://tox.readthedocs.io) to automate some aspects of development, including testing against multiple Python versions. -To install `tox`, run[^1]: +To install `tox`, run: ```console -$ pip install tox==3.27.1 +$ pip install tox ``` -[^1]: Right now we are experiencing issues with `tox==4.x.y`, so we recommend you use this version. - You can run `tox` with the following arguments: - `tox` to run all existing tox commands, including unit tests for all packages diff --git a/tox.ini b/tox.ini index 035f8269e37..bd931d55ff9 100644 --- a/tox.ini +++ b/tox.ini @@ -90,8 +90,8 @@ deps = setenv = ; override CONTRIB_REPO_SHA via env variable when testing other branches/commits than main ; i.e: CONTRIB_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e - CONTRIB_REPO_SHA={env:CONTRIB_REPO_SHA:"main"} - CONTRIB_REPO="git+https://github.com/open-telemetry/opentelemetry-python-contrib.git@{env:CONTRIB_REPO_SHA}" + CONTRIB_REPO_SHA={env:CONTRIB_REPO_SHA:main} + CONTRIB_REPO=git+https://github.com/open-telemetry/opentelemetry-python-contrib.git@{env:CONTRIB_REPO_SHA} mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/:{toxinidir}/tests/opentelemetry-test-utils/src/ changedir = @@ -127,11 +127,11 @@ commands_pre = protobuf: pip install {toxinidir}/opentelemetry-proto getting-started: pip install -r requirements.txt - getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http" - getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation" - getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests" - getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi" - getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-flask&subdirectory=instrumentation/opentelemetry-instrumentation-flask" + getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http + getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation + getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests + getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi + getting-started: pip install -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-flask&subdirectory=instrumentation/opentelemetry-instrumentation-flask opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus @@ -255,14 +255,17 @@ deps = requests~=2.7 markupsafe~=2.1 +allowlist_externals = + {toxinidir}/scripts/tracecontext-integration-test.sh + commands_pre = pip install -e {toxinidir}/opentelemetry-api \ -e {toxinidir}/opentelemetry-semantic-conventions \ -e {toxinidir}/opentelemetry-sdk \ - -e "{env:CONTRIB_REPO}#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http" \ - -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation" \ - -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests" \ - -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi" + -e {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http \ + -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation \ + -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests \ + -e {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi commands = {toxinidir}/scripts/tracecontext-integration-test.sh From 07a25b7d838ecd3324549ea6bbe926f9d47e32cf Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 11:08:05 +0100 Subject: [PATCH 02/14] Remove tox-factor --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/public-api-check.yml | 2 +- .github/workflows/test.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 5ac893cfae0..4fccfe73524 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -25,7 +25,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox -U tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 diff --git a/.github/workflows/public-api-check.yml b/.github/workflows/public-api-check.yml index 1304b9e23f7..67dcb798310 100644 --- a/.github/workflows/public-api-check.yml +++ b/.github/workflows/public-api-check.yml @@ -34,7 +34,7 @@ jobs: python-version: '3.10' - name: Install tox - run: pip install tox -U tox-factor + run: pip install tox - name: Public API Check run: tox -e public-symbols-check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f1733c199e..e1f9cebdd45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox -U tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 @@ -191,7 +191,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox -U tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 From a6753beeb83271571fbed9c01cd19eaa14e508e1 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 11:52:17 +0100 Subject: [PATCH 03/14] Bump tox cache --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1f9cebdd45..7827d6836af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,7 +75,7 @@ jobs: path: | .tox ~/.cache/pip - key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', + key: v4-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core - name: Windows does not let git check out files with long names if: ${{ matrix.os == 'windows-2019'}} @@ -108,7 +108,7 @@ jobs: path: | .tox ~/.cache/pip - key: v3-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') + key: v4-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core - name: run tox run: tox -e ${{ matrix.tox-environment }} From d074c30790e974ac2daee1627a7a317e26951c66 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 12:44:24 +0100 Subject: [PATCH 04/14] Remove exporter-jaeger from matrix These tests were removed in 2a8d4ed433feb8f4ba8db141643773e6f097bdca, but tox-factor just ignored the problem, but tox 4 fails because the env does not exist. --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7827d6836af..4bd52683d76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,9 +42,6 @@ jobs: - "getting-started" - "opentracing-shim" - "opencensus-shim" - - "exporter-jaeger-combined" - - "exporter-jaeger-proto-grpc" - - "exporter-jaeger-thrift" - "exporter-opencensus" - "exporter-otlp-proto-common" - "exporter-otlp-combined" From 172df19ecc11a77b2bf9086a6dab45c36925d166 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 12:44:35 +0100 Subject: [PATCH 05/14] Ignore py37 getting-started The py37 env was removed in 4a2cb86f2885159d9e3f8d5f04fe409640df23e4 and now tox 4 fails instead of ignore it like tox-factor. --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bd52683d76..a42a442720a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,10 @@ jobs: - "propagator-b3" - "propagator-jaeger" os: [ubuntu-20.04, windows-2019] + exclude: + - python-version: py37 + package: "getting-started" + steps: - name: Checkout Core Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v2 From 7bab0146166c0d0639031099e60f412c8b327533 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 13:09:05 +0100 Subject: [PATCH 06/14] Ignore pypy3 for some packages --- .github/workflows/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a42a442720a..046ff21c032 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,16 @@ jobs: os: [ubuntu-20.04, windows-2019] exclude: - python-version: py37 - package: "getting-started" + package: + - "getting-started" + - python-version: pypy3 + package: + - "getting-started" + - "opencensus-shim" + - "exporter-opencensus" + - "exporter-otlp-proto-common" + - "exporter-otlp-combined" + - "exporter-otlp-proto-grpc" steps: - name: Checkout Core Repo @ SHA - ${{ github.sha }} From dc2db01e306748b2c9ef96f970eaaad1bf39a346 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 13:45:14 +0100 Subject: [PATCH 07/14] Github actions exclude does not accept arrays --- .github/workflows/test.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 046ff21c032..ffe755bc06a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,16 +57,19 @@ jobs: os: [ubuntu-20.04, windows-2019] exclude: - python-version: py37 - package: - - "getting-started" + package: "getting-started" - python-version: pypy3 - package: - - "getting-started" - - "opencensus-shim" - - "exporter-opencensus" - - "exporter-otlp-proto-common" - - "exporter-otlp-combined" - - "exporter-otlp-proto-grpc" + package: "getting-started" + - python-version: pypy3 + package: "opencensus-shim" + - python-version: pypy3 + package: "exporter-opencensus" + - python-version: pypy3 + package: "exporter-otlp-proto-common" + - python-version: pypy3 + package: "exporter-otlp-combined" + - python-version: pypy3 + package: "exporter-otlp-proto-grpc" steps: - name: Checkout Core Repo @ SHA - ${{ github.sha }} From cb2ca1eb4ce4ae4a9ca325b11903568d72e2ac4b Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 13:18:24 +0100 Subject: [PATCH 08/14] Contrib tests still running on tox 3 --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffe755bc06a..1eff518d62f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -204,7 +204,8 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install tox + # TODO: Bump contrib tox to v4 + run: pip install tox==3.27.1 -U tox-factor - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 From 9b881aabd521e77931e816446475cfd490ec1b0c Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 13:52:58 +0100 Subject: [PATCH 09/14] Revert "Contrib tests still running on tox 3" This reverts commit fdcd75db7b5ef3e59850ff55bf70ea1521dbaa74. --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1eff518d62f..ffe755bc06a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -204,8 +204,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - # TODO: Bump contrib tox to v4 - run: pip install tox==3.27.1 -U tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 From dc3c88b9ef6f808a74916a3d78e5911fb1a261bd Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 12 Feb 2024 19:02:33 -0600 Subject: [PATCH 10/14] Update contrib SHA --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffe755bc06a..935e536ad3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ env: # Otherwise, set variable to the commit of your branch on # opentelemetry-python-contrib which is compatible with these Core repo # changes. - CONTRIB_REPO_SHA: d167ef7b43941a74378d625fea74628dd7572efa + CONTRIB_REPO_SHA: de8c5c63fdc69193a12b8aa92425319adea74d2d # This is needed because we do not clone the core repo in contrib builds anymore. # When running contrib builds as part of core builds, we use actions/checkout@v2 which # does not set an environment variable (simply just runs tox), which is different when From 1cf7b42db092248e7e11951c675852796b8ff745 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 18:07:57 -0600 Subject: [PATCH 11/14] Remove excludes --- .github/workflows/test.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 935e536ad3c..50ecc9def35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,21 +55,6 @@ jobs: - "propagator-b3" - "propagator-jaeger" os: [ubuntu-20.04, windows-2019] - exclude: - - python-version: py37 - package: "getting-started" - - python-version: pypy3 - package: "getting-started" - - python-version: pypy3 - package: "opencensus-shim" - - python-version: pypy3 - package: "exporter-opencensus" - - python-version: pypy3 - package: "exporter-otlp-proto-common" - - python-version: pypy3 - package: "exporter-otlp-combined" - - python-version: pypy3 - package: "exporter-otlp-proto-grpc" steps: - name: Checkout Core Repo @ SHA - ${{ github.sha }} From d4da3ba2f574aa1b44b54540306d28fcbdf05283 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 22:24:19 -0600 Subject: [PATCH 12/14] Revert "Remove excludes" This reverts commit 1cf7b42db092248e7e11951c675852796b8ff745. --- .github/workflows/test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50ecc9def35..935e536ad3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,21 @@ jobs: - "propagator-b3" - "propagator-jaeger" os: [ubuntu-20.04, windows-2019] + exclude: + - python-version: py37 + package: "getting-started" + - python-version: pypy3 + package: "getting-started" + - python-version: pypy3 + package: "opencensus-shim" + - python-version: pypy3 + package: "exporter-opencensus" + - python-version: pypy3 + package: "exporter-otlp-proto-common" + - python-version: pypy3 + package: "exporter-otlp-combined" + - python-version: pypy3 + package: "exporter-otlp-proto-grpc" steps: - name: Checkout Core Repo @ SHA - ${{ github.sha }} From b20102af4db076eed3b9951671fc28a75e804829 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 22:33:47 -0600 Subject: [PATCH 13/14] WIP --- .github/workflows/test.yml | 4 ++-- tox.ini | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 935e536ad3c..67398bf78f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ env: # Otherwise, set variable to the commit of your branch on # opentelemetry-python-contrib which is compatible with these Core repo # changes. - CONTRIB_REPO_SHA: de8c5c63fdc69193a12b8aa92425319adea74d2d + CONTRIB_REPO_SHA: 1a984d3ba18d4080c58485b7d807dba241179d41 # This is needed because we do not clone the core repo in contrib builds anymore. # When running contrib builds as part of core builds, we use actions/checkout@v2 which # does not set an environment variable (simply just runs tox), which is different when @@ -182,7 +182,7 @@ jobs: - "tornado" - "tortoiseorm" - "urllib" - - "urllib3" + - "urllib3v" - "wsgi" - "prometheus-remote-write" - "richconsole" diff --git a/tox.ini b/tox.ini index bd931d55ff9..1bd0c98226e 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,7 @@ envlist = ; docs/getting-started py3{8,9,10,11}-opentelemetry-getting-started + pypy3-opentelemetry-getting-started py3{8,9,10,11}-opentelemetry-opentracing-shim pypy3-opentelemetry-opentracing-shim @@ -31,6 +32,7 @@ envlist = ; exporter-opencensus intentionally excluded from pypy3 py3{8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-common + pypy3-proto{3,4}-opentelemetry-exporter-otlp-proto-common ; opentelemetry-exporter-otlp py3{8,9,10,11}-opentelemetry-exporter-otlp-combined From c7204f9908d4e16fbf60f918e8d37f66a8ead72e Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 23:03:39 -0600 Subject: [PATCH 14/14] More WIP --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67398bf78f1..0457d584f2f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,16 +56,10 @@ jobs: - "propagator-jaeger" os: [ubuntu-20.04, windows-2019] exclude: - - python-version: py37 - package: "getting-started" - - python-version: pypy3 - package: "getting-started" - python-version: pypy3 package: "opencensus-shim" - python-version: pypy3 package: "exporter-opencensus" - - python-version: pypy3 - package: "exporter-otlp-proto-common" - python-version: pypy3 package: "exporter-otlp-combined" - python-version: pypy3