From 7c00cc5414a96ee0ec12689f8adeb47e3175df58 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Sun, 7 Jan 2024 13:34:52 +0100 Subject: [PATCH 1/3] Upgrade tox --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- .github/workflows/prepare-patch-release.yml | 2 +- .github/workflows/prepare-release-branch.yml | 4 +-- .github/workflows/test.yml | 2 +- CONTRIBUTING.md | 6 ++-- README.md | 2 +- tox.ini | 36 ++++++++++---------- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index d6a1d688e6..e290b2c3db 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -81,7 +81,7 @@ jobs: with: python-version: ${{ env[matrix.python-version] }} - name: Install tox - 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 uses: actions/cache@v1 diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 7b1a0925cf..4911a15169 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -43,7 +43,7 @@ jobs: with: python-version: ${{ env[matrix.python-version] }} - name: Install tox - 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 uses: actions/cache@v1 diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 42e287f981..49b9c89560 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -54,7 +54,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index 229c8ac7e6..a4caf86ebe 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -81,7 +81,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate @@ -165,7 +165,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33791db4cd..2c5a86922f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: with: python-version: "3.10" - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: Install libsnappy-dev if: ${{ matrix.tox-environment == 'lint' }} run: sudo apt-get install -y libsnappy-dev diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb5f649e13..329962955c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ some aspects of development, including testing against multiple Python versions. To install `tox`, run: ```console -$ pip install tox==3.27.1 +$ pip install tox ``` You can run `tox` with the following arguments: @@ -107,7 +107,7 @@ Run tests: ```sh # make sure you have all supported versions of Python installed -$ pip install tox==3.27.1 # only first time. +$ pip install tox # only first time. $ tox # execute in the root of the repository ``` @@ -177,7 +177,7 @@ For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-sp ## Running Tests Locally 1. Go to your Contrib repo directory. `git clone git@github.com:open-telemetry/opentelemetry-python-contrib.git && cd opentelemetry-python-contrib`. -2. Make sure you have `tox` installed. `pip install tox==3.27.1`. +2. Make sure you have `tox` installed. `pip install tox`. 3. Run `tox` without any arguments to run tests for all the packages. Read more about [tox](https://tox.readthedocs.io/en/latest/). ### Testing against a different Core repo branch/commit diff --git a/README.md b/README.md index ce1f8f3df4..0a3d37ab3f 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Emeritus Maintainers: 1. Go to your Contrib repo directory. `cd ~/git/opentelemetry-python-contrib`. 2. Create a virtual env in your Contrib repo directory. `python3 -m venv my_test_venv`. 3. Activate your virtual env. `source my_test_venv/bin/activate`. -4. Make sure you have `tox` installed. `pip install tox==3.27.1`. +4. Make sure you have `tox` installed. `pip install tox`. 5. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.) ### Thanks to all the people who already contributed! diff --git a/tox.ini b/tox.ini index 5c4645364d..4586b6f03a 100644 --- a/tox.ini +++ b/tox.ini @@ -295,7 +295,7 @@ setenv = ; override CORE_REPO_SHA via env variable when testing other branches/commits than main ; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e CORE_REPO_SHA={env:CORE_REPO_SHA:main} - CORE_REPO="git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}" + CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA} changedir = test-distro: opentelemetry-distro/tests @@ -358,10 +358,10 @@ commands_pre = py3{8,9,10,11}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. - test: pip install "opentelemetry-api[test] @ {env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - test: pip install "opentelemetry-semantic-conventions[test] @ {env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - test: pip install "opentelemetry-sdk[test] @ {env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" - test: pip install "opentelemetry-test-utils[test] @ {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-semantic-conventions[test]@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + test: pip install opentelemetry-sdk[test]@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + test: pip install opentelemetry-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils test: pip install {toxinidir}/opentelemetry-instrumentation distro: pip install {toxinidir}/opentelemetry-distro @@ -487,9 +487,9 @@ deps = pytest commands_pre = - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk python -m pip install {toxinidir}/opentelemetry-instrumentation python -m pip install {toxinidir}/util/opentelemetry-util-http @@ -514,11 +514,11 @@ deps = -r dev-requirements.txt commands_pre = - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" - python -m pip install -e {toxinidir}/util/opentelemetry-util-http + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils + python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] @@ -609,10 +609,10 @@ changedir = tests/opentelemetry-docker-tests/tests commands_pre = - pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" \ - "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" \ - "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" \ - "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" \ + pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api \ + {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \ + {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk \ + {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ @@ -629,7 +629,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade \ - "{env:CORE_REPO}#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus" + {env:CORE_REPO}\#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus docker-compose up -d python check_availability.py From c477d9477e7535ace7f6e1118e07b08ebad99761 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 8 Jan 2024 17:51:13 +0100 Subject: [PATCH 2/3] fixup! Upgrade tox --- tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tox.ini b/tox.ini index 4586b6f03a..233ee54d03 100644 --- a/tox.ini +++ b/tox.ini @@ -643,6 +643,11 @@ commands_post = deps = -r {toxinidir}/gen-requirements.txt +allowlist_externals = + {toxinidir}/scripts/generate_instrumentation_bootstrap.py + {toxinidir}/scripts/generate_instrumentation_readme.py + {toxinidir}/scripts/generate_instrumentation_metapackage.py + commands = {toxinidir}/scripts/generate_instrumentation_bootstrap.py {toxinidir}/scripts/generate_instrumentation_readme.py From a34f19624e914f035c0f68d1bb68e7ac3c00a4d3 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 22:09:36 -0600 Subject: [PATCH 3/3] Add excludes --- .github/workflows/instrumentations_0.yml | 29 +++++++++++++++++++ .github/workflows/instrumentations_1.yml | 5 ++++ .../pyproject.toml | 3 -- tox.ini | 16 ++++++---- 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index e290b2c3db..92ab15d4e0 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -73,6 +73,35 @@ jobs: - "tornado" - "tortoiseorm" os: [ubuntu-20.04] + exclude: + - python-version: py39 + package: "sklearn" + - python-version: py310 + package: "sklearn" + - python-version: py311 + package: "sklearn" + - python-version: pypy3 + package: "aiopg" + - python-version: pypy3 + package: "asyncpg" + - python-version: pypy3 + package: "boto" + - python-version: pypy3 + package: "boto3sqs" + - python-version: pypy3 + package: "botocore" + - python-version: pypy3 + package: "psycopg2" + - python-version: pypy3 + package: "remoulade" + - python-version: pypy3 + package: "requests" + - python-version: pypy3 + package: "sklearn" + - python-version: pypy3 + package: "confluent-kafka" + - python-version: pypy3 + package: "grpc" steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v2 diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 4911a15169..931ab5d68e 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -35,6 +35,11 @@ jobs: - "propagator-ot-trace" - "resource-detector-container" os: [ubuntu-20.04] + exclude: + - python-version: py311 + package: "prometheus-remote-write" + - python-version: pypy3 + package: "prometheus-remote-write" steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v2 diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 83dcb82a6f..4ded0836b2 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -19,9 +19,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/tox.ini b/tox.ini index 233ee54d03..3b921b9be1 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,8 @@ envlist = ; instrumentation-aiopg intentionally excluded from pypy3 ; opentelemetry-instrumentation-aws-lambda - py3{8,9}-test-instrumentation-aws-lambda + py3{8,9,10,11}-test-instrumentation-aws-lambda + pypy3-test-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore py3{8,9,10,11}-test-instrumentation-botocore @@ -92,7 +93,7 @@ envlist = ; opentelemetry-instrumentation-urllib3 py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2} - ;pypy3-test-instrumentation-urllib3v-{1,2} + pypy3-test-instrumentation-urllib3v-{1,2} ; opentelemetry-instrumentation-requests py3{8,9,10,11}-test-instrumentation-requests @@ -112,9 +113,11 @@ envlist = ; opentelemetry-exporter-richconsole py3{8,9,10,11}-test-exporter-richconsole + pypy3-test-exporter-richconsole ; opentelemetry-exporter-prometheus-remote-write - py3{6,8,9,10}-test-exporter-prometheus-remote-write + py3{6,8,9,10,11}-test-exporter-prometheus-remote-write + pypy3-test-exporter-prometheus-remote-write ; opentelemetry-instrumentation-mysql py3{8,9,10,11}-test-instrumentation-mysql @@ -162,6 +165,7 @@ envlist = ; opentelemetry-instrumentation-grpc py3{8,9,10,11}-test-instrumentation-grpc + pypy3-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} @@ -177,7 +181,7 @@ envlist = ; opentelemetry-instrumentation-celery py3{8,9,10,11}-test-instrumentation-celery - ; pypy3-test-instrumentation-celery + pypy3-test-instrumentation-celery ; opentelemetry-instrumentation-sklearn py3{8}-test-instrumentation-sklearn @@ -223,8 +227,8 @@ envlist = pypy3-test-instrumentation-kafka-python ; opentelemetry-instrumentation-confluent-kafka - ; // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed - py3{8,9,10}-test-instrumentation-confluent-kafka + py3{8,9,10,11}-test-instrumentation-confluent-kafka + pypy3-test-instrumentation-confluent-kafka ; opentelemetry-instrumentation-cassandra py3{8,9,10,11}-test-instrumentation-cassandra