Skip to content

Commit 1a984d3

Browse files
iurisilvioocelotl
andauthored
Upgrade tox (#2118)
* Upgrade tox * fixup! Upgrade tox * Add excludes --------- Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
1 parent 03fcc17 commit 1a984d3

File tree

9 files changed

+77
-37
lines changed

9 files changed

+77
-37
lines changed

.github/workflows/instrumentations_0.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,35 @@ jobs:
7373
- "tornado"
7474
- "tortoiseorm"
7575
os: [ubuntu-20.04]
76+
exclude:
77+
- python-version: py39
78+
package: "sklearn"
79+
- python-version: py310
80+
package: "sklearn"
81+
- python-version: py311
82+
package: "sklearn"
83+
- python-version: pypy3
84+
package: "aiopg"
85+
- python-version: pypy3
86+
package: "asyncpg"
87+
- python-version: pypy3
88+
package: "boto"
89+
- python-version: pypy3
90+
package: "boto3sqs"
91+
- python-version: pypy3
92+
package: "botocore"
93+
- python-version: pypy3
94+
package: "psycopg2"
95+
- python-version: pypy3
96+
package: "remoulade"
97+
- python-version: pypy3
98+
package: "requests"
99+
- python-version: pypy3
100+
package: "sklearn"
101+
- python-version: pypy3
102+
package: "confluent-kafka"
103+
- python-version: pypy3
104+
package: "grpc"
76105
steps:
77106
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
78107
uses: actions/checkout@v2
@@ -81,7 +110,7 @@ jobs:
81110
with:
82111
python-version: ${{ env[matrix.python-version] }}
83112
- name: Install tox
84-
run: pip install tox==3.27.1 tox-factor
113+
run: pip install tox
85114
- name: Cache tox environment
86115
# Preserves .tox directory between runs for faster installs
87116
uses: actions/cache@v1

.github/workflows/instrumentations_1.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
- "propagator-ot-trace"
3636
- "resource-detector-container"
3737
os: [ubuntu-20.04]
38+
exclude:
39+
- python-version: py311
40+
package: "prometheus-remote-write"
41+
- python-version: pypy3
42+
package: "prometheus-remote-write"
3843
steps:
3944
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
4045
uses: actions/checkout@v2
@@ -43,7 +48,7 @@ jobs:
4348
with:
4449
python-version: ${{ env[matrix.python-version] }}
4550
- name: Install tox
46-
run: pip install tox==3.27.1 tox-factor
51+
run: pip install tox
4752
- name: Cache tox environment
4853
# Preserves .tox directory between runs for faster installs
4954
uses: actions/cache@v1

.github/workflows/prepare-patch-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
python-version: 3.9
5656
- name: Install tox
57-
run: pip install tox==3.27.1
57+
run: pip install tox
5858
- name: run tox
5959
run: tox -e generate
6060

.github/workflows/prepare-release-branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
with:
8282
python-version: 3.9
8383
- name: Install tox
84-
run: pip install tox==3.27.1
84+
run: pip install tox
8585
- name: run tox
8686
run: tox -e generate
8787

@@ -165,7 +165,7 @@ jobs:
165165
with:
166166
python-version: 3.9
167167
- name: Install tox
168-
run: pip install tox==3.27.1
168+
run: pip install tox
169169
- name: run tox
170170
run: tox -e generate
171171

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
python-version: "3.10"
2626
- name: Install tox
27-
run: pip install tox==3.27.1
27+
run: pip install tox
2828
- name: Install libsnappy-dev
2929
if: ${{ matrix.tox-environment == 'lint' }}
3030
run: sudo apt-get install -y libsnappy-dev

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ some aspects of development, including testing against multiple Python versions.
3232
To install `tox`, run:
3333

3434
```console
35-
$ pip install tox==3.27.1
35+
$ pip install tox
3636
```
3737

3838
You can run `tox` with the following arguments:
@@ -107,7 +107,7 @@ Run tests:
107107

108108
```sh
109109
# make sure you have all supported versions of Python installed
110-
$ pip install tox==3.27.1 # only first time.
110+
$ pip install tox # only first time.
111111
$ tox # execute in the root of the repository
112112
```
113113

@@ -177,7 +177,7 @@ For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-sp
177177
## Running Tests Locally
178178

179179
1. Go to your Contrib repo directory. `git clone git@github.com:open-telemetry/opentelemetry-python-contrib.git && cd opentelemetry-python-contrib`.
180-
2. Make sure you have `tox` installed. `pip install tox==3.27.1`.
180+
2. Make sure you have `tox` installed. `pip install tox`.
181181
3. Run `tox` without any arguments to run tests for all the packages. Read more about [tox](https://tox.readthedocs.io/en/latest/).
182182

183183
### Testing against a different Core repo branch/commit

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Emeritus Maintainers:
128128
1. Go to your Contrib repo directory. `cd ~/git/opentelemetry-python-contrib`.
129129
2. Create a virtual env in your Contrib repo directory. `python3 -m venv my_test_venv`.
130130
3. Activate your virtual env. `source my_test_venv/bin/activate`.
131-
4. Make sure you have `tox` installed. `pip install tox==3.27.1`.
131+
4. Make sure you have `tox` installed. `pip install tox`.
132132
5. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.)
133133

134134
### Thanks to all the people who already contributed!

instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ classifiers = [
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
2121
"Programming Language :: Python :: 3.8",
22-
"Programming Language :: Python :: 3.9",
23-
"Programming Language :: Python :: 3.10",
24-
"Programming Language :: Python :: 3.11",
2522
]
2623
dependencies = [
2724
"opentelemetry-api ~= 1.12",

tox.ini

+33-24
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ envlist =
3535
; instrumentation-aiopg intentionally excluded from pypy3
3636

3737
; opentelemetry-instrumentation-aws-lambda
38-
py3{8,9}-test-instrumentation-aws-lambda
38+
py3{8,9,10,11}-test-instrumentation-aws-lambda
39+
pypy3-test-instrumentation-aws-lambda
3940

4041
; opentelemetry-instrumentation-botocore
4142
py3{8,9,10,11}-test-instrumentation-botocore
@@ -92,7 +93,7 @@ envlist =
9293

9394
; opentelemetry-instrumentation-urllib3
9495
py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2}
95-
;pypy3-test-instrumentation-urllib3v-{1,2}
96+
pypy3-test-instrumentation-urllib3v-{1,2}
9697

9798
; opentelemetry-instrumentation-requests
9899
py3{8,9,10,11}-test-instrumentation-requests
@@ -112,9 +113,11 @@ envlist =
112113

113114
; opentelemetry-exporter-richconsole
114115
py3{8,9,10,11}-test-exporter-richconsole
116+
pypy3-test-exporter-richconsole
115117

116118
; opentelemetry-exporter-prometheus-remote-write
117-
py3{6,8,9,10}-test-exporter-prometheus-remote-write
119+
py3{6,8,9,10,11}-test-exporter-prometheus-remote-write
120+
pypy3-test-exporter-prometheus-remote-write
118121

119122
; opentelemetry-instrumentation-mysql
120123
py3{8,9,10,11}-test-instrumentation-mysql
@@ -162,6 +165,7 @@ envlist =
162165

163166
; opentelemetry-instrumentation-grpc
164167
py3{8,9,10,11}-test-instrumentation-grpc
168+
pypy3-test-instrumentation-grpc
165169

166170
; opentelemetry-instrumentation-sqlalchemy
167171
py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14}
@@ -177,7 +181,7 @@ envlist =
177181

178182
; opentelemetry-instrumentation-celery
179183
py3{8,9,10,11}-test-instrumentation-celery
180-
; pypy3-test-instrumentation-celery
184+
pypy3-test-instrumentation-celery
181185

182186
; opentelemetry-instrumentation-sklearn
183187
py3{8}-test-instrumentation-sklearn
@@ -223,8 +227,8 @@ envlist =
223227
pypy3-test-instrumentation-kafka-python
224228

225229
; opentelemetry-instrumentation-confluent-kafka
226-
; // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed
227-
py3{8,9,10}-test-instrumentation-confluent-kafka
230+
py3{8,9,10,11}-test-instrumentation-confluent-kafka
231+
pypy3-test-instrumentation-confluent-kafka
228232

229233
; opentelemetry-instrumentation-cassandra
230234
py3{8,9,10,11}-test-instrumentation-cassandra
@@ -295,7 +299,7 @@ setenv =
295299
; override CORE_REPO_SHA via env variable when testing other branches/commits than main
296300
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
297301
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
298-
CORE_REPO="git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}"
302+
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}
299303

300304
changedir =
301305
test-distro: opentelemetry-distro/tests
@@ -358,10 +362,10 @@ commands_pre =
358362
py3{8,9,10,11}: python -m pip install -U pip setuptools wheel
359363
; Install common packages for all the tests. These are not needed in all the
360364
; cases but it saves a lot of boilerplate in this file.
361-
test: pip install "opentelemetry-api[test] @ {env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api"
362-
test: pip install "opentelemetry-semantic-conventions[test] @ {env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions"
363-
test: pip install "opentelemetry-sdk[test] @ {env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk"
364-
test: pip install "opentelemetry-test-utils[test] @ {env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils"
365+
test: pip install opentelemetry-api[test]@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
366+
test: pip install opentelemetry-semantic-conventions[test]@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
367+
test: pip install opentelemetry-sdk[test]@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
368+
test: pip install opentelemetry-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
365369
test: pip install {toxinidir}/opentelemetry-instrumentation
366370

367371
distro: pip install {toxinidir}/opentelemetry-distro
@@ -487,9 +491,9 @@ deps =
487491
pytest
488492

489493
commands_pre =
490-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api"
491-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions"
492-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk"
494+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
495+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
496+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
493497
python -m pip install {toxinidir}/opentelemetry-instrumentation
494498
python -m pip install {toxinidir}/util/opentelemetry-util-http
495499

@@ -514,11 +518,11 @@ deps =
514518
-r dev-requirements.txt
515519

516520
commands_pre =
517-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api"
518-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions"
519-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk"
520-
python -m pip install "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils"
521-
python -m pip install -e {toxinidir}/util/opentelemetry-util-http
521+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
522+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
523+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
524+
python -m pip install {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
525+
python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test]
522526
python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test]
523527
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test]
524528
python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test]
@@ -609,10 +613,10 @@ changedir =
609613
tests/opentelemetry-docker-tests/tests
610614

611615
commands_pre =
612-
pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" \
613-
"{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" \
614-
"{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" \
615-
"{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" \
616+
pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api \
617+
{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \
618+
{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk \
619+
{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils \
616620
-e {toxinidir}/opentelemetry-instrumentation \
617621
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \
618622
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \
@@ -629,7 +633,7 @@ commands_pre =
629633
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \
630634
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \
631635
-e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade \
632-
"{env:CORE_REPO}#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus"
636+
{env:CORE_REPO}\#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus
633637
docker-compose up -d
634638
python check_availability.py
635639

@@ -643,6 +647,11 @@ commands_post =
643647
deps =
644648
-r {toxinidir}/gen-requirements.txt
645649

650+
allowlist_externals =
651+
{toxinidir}/scripts/generate_instrumentation_bootstrap.py
652+
{toxinidir}/scripts/generate_instrumentation_readme.py
653+
{toxinidir}/scripts/generate_instrumentation_metapackage.py
654+
646655
commands =
647656
{toxinidir}/scripts/generate_instrumentation_bootstrap.py
648657
{toxinidir}/scripts/generate_instrumentation_readme.py

0 commit comments

Comments
 (0)