Upgrade tox (#2118)

* Upgrade tox

* fixup! Upgrade tox

* Add excludes

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
This commit is contained in:
Iuri de Silvio
2024-02-14 01:33:14 -03:00
committed by GitHub
parent 03fcc1742d
commit 1a984d3ba1
9 changed files with 77 additions and 37 deletions

View File

@ -73,6 +73,35 @@ jobs:
- "tornado" - "tornado"
- "tortoiseorm" - "tortoiseorm"
os: [ubuntu-20.04] 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: steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }} - name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -81,7 +110,7 @@ jobs:
with: with:
python-version: ${{ env[matrix.python-version] }} python-version: ${{ env[matrix.python-version] }}
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 tox-factor run: pip install tox
- name: Cache tox environment - name: Cache tox environment
# Preserves .tox directory between runs for faster installs # Preserves .tox directory between runs for faster installs
uses: actions/cache@v1 uses: actions/cache@v1

View File

@ -35,6 +35,11 @@ jobs:
- "propagator-ot-trace" - "propagator-ot-trace"
- "resource-detector-container" - "resource-detector-container"
os: [ubuntu-20.04] os: [ubuntu-20.04]
exclude:
- python-version: py311
package: "prometheus-remote-write"
- python-version: pypy3
package: "prometheus-remote-write"
steps: steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }} - name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -43,7 +48,7 @@ jobs:
with: with:
python-version: ${{ env[matrix.python-version] }} python-version: ${{ env[matrix.python-version] }}
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 tox-factor run: pip install tox
- name: Cache tox environment - name: Cache tox environment
# Preserves .tox directory between runs for faster installs # Preserves .tox directory between runs for faster installs
uses: actions/cache@v1 uses: actions/cache@v1

View File

@ -54,7 +54,7 @@ jobs:
with: with:
python-version: 3.9 python-version: 3.9
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 run: pip install tox
- name: run tox - name: run tox
run: tox -e generate run: tox -e generate

View File

@ -81,7 +81,7 @@ jobs:
with: with:
python-version: 3.9 python-version: 3.9
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 run: pip install tox
- name: run tox - name: run tox
run: tox -e generate run: tox -e generate
@ -165,7 +165,7 @@ jobs:
with: with:
python-version: 3.9 python-version: 3.9
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 run: pip install tox
- name: run tox - name: run tox
run: tox -e generate run: tox -e generate

View File

@ -24,7 +24,7 @@ jobs:
with: with:
python-version: "3.10" python-version: "3.10"
- name: Install tox - name: Install tox
run: pip install tox==3.27.1 run: pip install tox
- name: Install libsnappy-dev - name: Install libsnappy-dev
if: ${{ matrix.tox-environment == 'lint' }} if: ${{ matrix.tox-environment == 'lint' }}
run: sudo apt-get install -y libsnappy-dev run: sudo apt-get install -y libsnappy-dev

View File

@ -32,7 +32,7 @@ some aspects of development, including testing against multiple Python versions.
To install `tox`, run: To install `tox`, run:
```console ```console
$ pip install tox==3.27.1 $ pip install tox
``` ```
You can run `tox` with the following arguments: You can run `tox` with the following arguments:
@ -107,7 +107,7 @@ Run tests:
```sh ```sh
# make sure you have all supported versions of Python installed # 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 $ 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 ## 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`. 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/). 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 ### Testing against a different Core repo branch/commit

View File

@ -128,7 +128,7 @@ Emeritus Maintainers:
1. Go to your Contrib repo directory. `cd ~/git/opentelemetry-python-contrib`. 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`. 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`. 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`.) 5. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.)
### Thanks to all the people who already contributed! ### Thanks to all the people who already contributed!

View File

@ -19,9 +19,6 @@ classifiers = [
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
] ]
dependencies = [ dependencies = [
"opentelemetry-api ~= 1.12", "opentelemetry-api ~= 1.12",

57
tox.ini
View File

@ -35,7 +35,8 @@ envlist =
; instrumentation-aiopg intentionally excluded from pypy3 ; instrumentation-aiopg intentionally excluded from pypy3
; opentelemetry-instrumentation-aws-lambda ; 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 ; opentelemetry-instrumentation-botocore
py3{8,9,10,11}-test-instrumentation-botocore py3{8,9,10,11}-test-instrumentation-botocore
@ -92,7 +93,7 @@ envlist =
; opentelemetry-instrumentation-urllib3 ; opentelemetry-instrumentation-urllib3
py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2} 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 ; opentelemetry-instrumentation-requests
py3{8,9,10,11}-test-instrumentation-requests py3{8,9,10,11}-test-instrumentation-requests
@ -112,9 +113,11 @@ envlist =
; opentelemetry-exporter-richconsole ; opentelemetry-exporter-richconsole
py3{8,9,10,11}-test-exporter-richconsole py3{8,9,10,11}-test-exporter-richconsole
pypy3-test-exporter-richconsole
; opentelemetry-exporter-prometheus-remote-write ; 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 ; opentelemetry-instrumentation-mysql
py3{8,9,10,11}-test-instrumentation-mysql py3{8,9,10,11}-test-instrumentation-mysql
@ -162,6 +165,7 @@ envlist =
; opentelemetry-instrumentation-grpc ; opentelemetry-instrumentation-grpc
py3{8,9,10,11}-test-instrumentation-grpc py3{8,9,10,11}-test-instrumentation-grpc
pypy3-test-instrumentation-grpc
; opentelemetry-instrumentation-sqlalchemy ; opentelemetry-instrumentation-sqlalchemy
py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14}
@ -177,7 +181,7 @@ envlist =
; opentelemetry-instrumentation-celery ; opentelemetry-instrumentation-celery
py3{8,9,10,11}-test-instrumentation-celery py3{8,9,10,11}-test-instrumentation-celery
; pypy3-test-instrumentation-celery pypy3-test-instrumentation-celery
; opentelemetry-instrumentation-sklearn ; opentelemetry-instrumentation-sklearn
py3{8}-test-instrumentation-sklearn py3{8}-test-instrumentation-sklearn
@ -223,8 +227,8 @@ envlist =
pypy3-test-instrumentation-kafka-python pypy3-test-instrumentation-kafka-python
; opentelemetry-instrumentation-confluent-kafka ; 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,11}-test-instrumentation-confluent-kafka
py3{8,9,10}-test-instrumentation-confluent-kafka pypy3-test-instrumentation-confluent-kafka
; opentelemetry-instrumentation-cassandra ; opentelemetry-instrumentation-cassandra
py3{8,9,10,11}-test-instrumentation-cassandra py3{8,9,10,11}-test-instrumentation-cassandra
@ -295,7 +299,7 @@ setenv =
; override CORE_REPO_SHA via env variable when testing other branches/commits than main ; override CORE_REPO_SHA via env variable when testing other branches/commits than main
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test> ; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
CORE_REPO_SHA={env:CORE_REPO_SHA:main} 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 = changedir =
test-distro: opentelemetry-distro/tests test-distro: opentelemetry-distro/tests
@ -358,10 +362,10 @@ commands_pre =
py3{8,9,10,11}: python -m pip install -U pip setuptools wheel 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 ; 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. ; 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-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-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-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-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
test: pip install {toxinidir}/opentelemetry-instrumentation test: pip install {toxinidir}/opentelemetry-instrumentation
distro: pip install {toxinidir}/opentelemetry-distro distro: pip install {toxinidir}/opentelemetry-distro
@ -487,9 +491,9 @@ deps =
pytest pytest
commands_pre = commands_pre =
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" 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-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-sdk&subdirectory=opentelemetry-sdk
python -m pip install {toxinidir}/opentelemetry-instrumentation python -m pip install {toxinidir}/opentelemetry-instrumentation
python -m pip install {toxinidir}/util/opentelemetry-util-http python -m pip install {toxinidir}/util/opentelemetry-util-http
@ -514,11 +518,11 @@ deps =
-r dev-requirements.txt -r dev-requirements.txt
commands_pre = commands_pre =
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" 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-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-sdk&subdirectory=opentelemetry-sdk
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" 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 -e {toxinidir}/util/opentelemetry-util-http[test]
python -m pip install -e {toxinidir}/opentelemetry-instrumentation[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-wsgi[test]
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test]
@ -609,10 +613,10 @@ changedir =
tests/opentelemetry-docker-tests/tests tests/opentelemetry-docker-tests/tests
commands_pre = commands_pre =
pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" \ 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-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \
"{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" \ {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk \
"{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" \ {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils \
-e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/opentelemetry-instrumentation \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \
@ -629,7 +633,7 @@ commands_pre =
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade \ -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 docker-compose up -d
python check_availability.py python check_availability.py
@ -643,6 +647,11 @@ commands_post =
deps = deps =
-r {toxinidir}/gen-requirements.txt -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 = commands =
{toxinidir}/scripts/generate_instrumentation_bootstrap.py {toxinidir}/scripts/generate_instrumentation_bootstrap.py
{toxinidir}/scripts/generate_instrumentation_readme.py {toxinidir}/scripts/generate_instrumentation_readme.py