Skip to content

Commit

Permalink
Upgrade tox (#2118)
Browse files Browse the repository at this point in the history
* Upgrade tox

* fixup! Upgrade tox

* Add excludes

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
  • Loading branch information
iurisilvio and ocelotl committed Feb 14, 2024
1 parent 03fcc17 commit 1a984d3
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 37 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/instrumentations_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -81,7 +110,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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,7 +48,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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
57 changes: 33 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -295,7 +299,7 @@ setenv =
; 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>
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
Expand Down Expand Up @@ -358,10 +362,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
Expand Down Expand Up @@ -487,9 +491,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

Expand All @@ -514,11 +518,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]
Expand Down Expand Up @@ -609,10 +613,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 \
Expand All @@ -629,7 +633,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

Expand All @@ -643,6 +647,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
Expand Down

0 comments on commit 1a984d3

Please sign in to comment.