From de8b9e030f0e2911fd89744de0c787c141a24c20 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 4 Jul 2024 12:54:14 -0600 Subject: [PATCH] Remove unnecessary dependencies `pytest`, `flaky` and `pytest-benchmark` (#4022) * Remove unnecessary dependencies pytest and pytest-benchmark Fixes #4021 * Separate runs for CI * Remove unnecessary flaky dependency * wPU * wer * wer * Try without -c dev-requirements * Try again for all packages * Another attempt separating both runs * Add mypy-requirements to keep mypy version --- .github/workflows/test.yml | 6 +++++- dev-requirements.txt | 1 - docs/getting_started/tests/requirements.txt | 2 -- .../test-requirements.txt | 2 -- .../test-requirements-0.txt | 2 -- .../test-requirements-1.txt | 2 -- .../test-requirements-0.txt | 1 - .../test-requirements-1.txt | 1 - .../test-requirements-0.txt | 2 -- .../test-requirements-1.txt | 2 -- exporter/opentelemetry-exporter-otlp/test-requirements.txt | 2 -- .../test-requirements.txt | 2 -- .../test-requirements.txt | 2 -- .../test-requirements.txt | 2 -- .../opentelemetry-exporter-zipkin/test-requirements.txt | 2 -- mypy-requirements.txt | 1 + opentelemetry-api/test-requirements.txt | 2 -- opentelemetry-proto/test-requirements-0.txt | 2 -- opentelemetry-proto/test-requirements-1.txt | 2 -- opentelemetry-semantic-conventions/test-requirements.txt | 2 -- .../opentelemetry-propagator-b3/test-requirements.txt | 1 - .../opentelemetry-propagator-jaeger/test-requirements.txt | 2 -- shim/opentelemetry-opencensus-shim/test-requirements.txt | 2 -- shim/opentelemetry-opentracing-shim/test-requirements.txt | 2 -- tests/opentelemetry-test-utils/test-requirements.txt | 2 -- tox.ini | 7 ++----- 26 files changed, 8 insertions(+), 48 deletions(-) create mode 100644 mypy-requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e20e32c1baa..cc19428329f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,8 +92,12 @@ jobs: - name: Windows does not let git check out files with long names if: ${{ matrix.os == 'windows-2019'}} run: git config --system core.longpaths true - - name: run tox + - name: run pytest with --benchmark-skip + if: ${{ matrix.package == 'sdk' || matrix.package == 'exporter-otlp-proto-grpc' }} run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-skip + - name: run pytest without --benchmark-skip + if: ${{ !(matrix.package == 'sdk' || matrix.package == 'exporter-otlp-proto-grpc') }} + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra misc: strategy: fail-fast: false diff --git a/dev-requirements.txt b/dev-requirements.txt index ea8c8430bb3..0e63f79d1ae 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -18,6 +18,5 @@ ruamel.yaml==0.17.21 asgiref==3.7.2 psutil==5.9.6 GitPython==3.1.41 -flaky==3.7.0 pre-commit==3.7.0; python_version >= '3.9' pre-commit==3.5.0; python_version < '3.9' diff --git a/docs/getting_started/tests/requirements.txt b/docs/getting_started/tests/requirements.txt index ba2a8c93f60..02276ce3ba9 100644 --- a/docs/getting_started/tests/requirements.txt +++ b/docs/getting_started/tests/requirements.txt @@ -4,7 +4,6 @@ certifi==2023.7.22 charset-normalizer==2.0.12 click==8.1.7 Deprecated==1.2.14 -flaky==3.7.0 Flask==2.3.3 idna==3.7 importlib-metadata==6.8.0 @@ -16,7 +15,6 @@ packaging==24.0 pluggy==1.3.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 requests==2.32.3 tomli==2.0.1 typing_extensions==4.8.0 diff --git a/exporter/opentelemetry-exporter-opencensus/test-requirements.txt b/exporter/opentelemetry-exporter-opencensus/test-requirements.txt index a1ba479481f..46e751a8092 100644 --- a/exporter/opentelemetry-exporter-opencensus/test-requirements.txt +++ b/exporter/opentelemetry-exporter-opencensus/test-requirements.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 grpcio==1.62.0 importlib-metadata==6.11.0 iniconfig==2.0.0 @@ -10,7 +9,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt index 2064aef53aa..9a6dce5bd97 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-0.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 @@ -8,7 +7,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt index db9bb1a8461..297b85e9f46 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-common/test-requirements-1.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 @@ -8,7 +7,6 @@ pluggy==1.5.0 protobuf==4.25.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt index cedf691d32e..f5bd68b42bd 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-0.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 googleapis-common-protos==1.62.0 grpcio==1.62.0 importlib-metadata==6.11.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt index 48cf91eb3b3..3ab26295cb1 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements-1.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 googleapis-common-protos==1.62.0 grpcio==1.62.0 importlib-metadata==6.11.0 diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt index c7b0de072e3..5a9304405b6 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt @@ -2,7 +2,6 @@ asgiref==3.7.2 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -flaky==3.7.0 googleapis-common-protos==1.62.0 idna==3.7 importlib-metadata==6.11.0 @@ -12,7 +11,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 PyYAML==6.0.1 requests==2.32.3 responses==0.24.1 diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt index 389363e1416..ad207ddc53d 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt +++ b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt @@ -2,7 +2,6 @@ asgiref==3.7.2 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -flaky==3.7.0 googleapis-common-protos==1.62.0 idna==3.7 importlib-metadata==6.11.0 @@ -12,7 +11,6 @@ pluggy==1.5.0 protobuf==4.25.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 PyYAML==6.0.1 requests==2.32.3 responses==0.24.1 diff --git a/exporter/opentelemetry-exporter-otlp/test-requirements.txt b/exporter/opentelemetry-exporter-otlp/test-requirements.txt index 77abdc28939..2cc6208c01e 100644 --- a/exporter/opentelemetry-exporter-otlp/test-requirements.txt +++ b/exporter/opentelemetry-exporter-otlp/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-prometheus/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus/test-requirements.txt index 1ece4378feb..c7f558e670a 100644 --- a/exporter/opentelemetry-exporter-prometheus/test-requirements.txt +++ b/exporter/opentelemetry-exporter-prometheus/test-requirements.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 @@ -8,7 +7,6 @@ pluggy==1.5.0 prometheus_client==0.20.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt b/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt index 58b16577132..b9ba9dd3b74 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt +++ b/exporter/opentelemetry-exporter-zipkin-json/test-requirements.txt @@ -2,7 +2,6 @@ asgiref==3.7.2 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -flaky==3.7.0 idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 @@ -10,7 +9,6 @@ packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 requests==2.32.3 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt b/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt index 1459830d2f5..9ca8fc39a5d 100644 --- a/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt +++ b/exporter/opentelemetry-exporter-zipkin-proto-http/test-requirements.txt @@ -2,7 +2,6 @@ asgiref==3.7.2 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -flaky==3.7.0 idna==3.7 importlib-metadata==6.11.0 iniconfig==2.0.0 @@ -11,7 +10,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 requests==2.32.3 tomli==2.0.1 typing_extensions==4.10.0 diff --git a/exporter/opentelemetry-exporter-zipkin/test-requirements.txt b/exporter/opentelemetry-exporter-zipkin/test-requirements.txt index 58b36fd8dc4..bfffbb10e9c 100644 --- a/exporter/opentelemetry-exporter-zipkin/test-requirements.txt +++ b/exporter/opentelemetry-exporter-zipkin/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/mypy-requirements.txt b/mypy-requirements.txt new file mode 100644 index 00000000000..6b0535fc1cf --- /dev/null +++ b/mypy-requirements.txt @@ -0,0 +1 @@ +mypy==1.9.0 diff --git a/opentelemetry-api/test-requirements.txt b/opentelemetry-api/test-requirements.txt index 3c84695a9f5..7f58c82a604 100644 --- a/opentelemetry-api/test-requirements.txt +++ b/opentelemetry-api/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/opentelemetry-proto/test-requirements-0.txt b/opentelemetry-proto/test-requirements-0.txt index e0c81702d5c..d99d2658828 100644 --- a/opentelemetry-proto/test-requirements-0.txt +++ b/opentelemetry-proto/test-requirements-0.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 @@ -8,7 +7,6 @@ pluggy==1.5.0 protobuf==3.20.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/opentelemetry-proto/test-requirements-1.txt b/opentelemetry-proto/test-requirements-1.txt index 94ac76cd274..449ec2febd4 100644 --- a/opentelemetry-proto/test-requirements-1.txt +++ b/opentelemetry-proto/test-requirements-1.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 @@ -8,7 +7,6 @@ pluggy==1.5.0 protobuf==4.25.3 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/opentelemetry-semantic-conventions/test-requirements.txt b/opentelemetry-semantic-conventions/test-requirements.txt index 643c7020226..39e75f7de2b 100644 --- a/opentelemetry-semantic-conventions/test-requirements.txt +++ b/opentelemetry-semantic-conventions/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/propagator/opentelemetry-propagator-b3/test-requirements.txt b/propagator/opentelemetry-propagator-b3/test-requirements.txt index 11b66c927f0..8ffc454a196 100644 --- a/propagator/opentelemetry-propagator-b3/test-requirements.txt +++ b/propagator/opentelemetry-propagator-b3/test-requirements.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 diff --git a/propagator/opentelemetry-propagator-jaeger/test-requirements.txt b/propagator/opentelemetry-propagator-jaeger/test-requirements.txt index 4bf6e889fbb..8ff3b0a6521 100644 --- a/propagator/opentelemetry-propagator-jaeger/test-requirements.txt +++ b/propagator/opentelemetry-propagator-jaeger/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/shim/opentelemetry-opencensus-shim/test-requirements.txt b/shim/opentelemetry-opencensus-shim/test-requirements.txt index c086f3d0268..c4d399c4a1a 100644 --- a/shim/opentelemetry-opencensus-shim/test-requirements.txt +++ b/shim/opentelemetry-opencensus-shim/test-requirements.txt @@ -3,7 +3,6 @@ cachetools==5.3.3 certifi==2024.2.2 charset-normalizer==3.3.2 Deprecated==1.2.14 -flaky==3.7.0 google-api-core==2.17.1 google-auth==2.28.1 googleapis-common-protos==1.62.0 @@ -21,7 +20,6 @@ py-cpuinfo==9.0.0 pyasn1==0.5.1 pyasn1-modules==0.3.0 pytest==7.4.4 -pytest-benchmark==4.0.0 requests==2.32.3 rsa==4.9 six==1.16.0 diff --git a/shim/opentelemetry-opentracing-shim/test-requirements.txt b/shim/opentelemetry-opentracing-shim/test-requirements.txt index dd60feddaa7..f8bc4095cca 100644 --- a/shim/opentelemetry-opentracing-shim/test-requirements.txt +++ b/shim/opentelemetry-opentracing-shim/test-requirements.txt @@ -1,6 +1,5 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 opentracing==2.4.0 @@ -8,7 +7,6 @@ packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/tests/opentelemetry-test-utils/test-requirements.txt b/tests/opentelemetry-test-utils/test-requirements.txt index 951312645c1..ec1e418f78f 100644 --- a/tests/opentelemetry-test-utils/test-requirements.txt +++ b/tests/opentelemetry-test-utils/test-requirements.txt @@ -1,13 +1,11 @@ asgiref==3.7.2 Deprecated==1.2.14 -flaky==3.7.0 importlib-metadata==6.11.0 iniconfig==2.0.0 packaging==24.0 pluggy==1.5.0 py-cpuinfo==9.0.0 pytest==7.4.4 -pytest-benchmark==4.0.0 tomli==2.0.1 typing_extensions==4.10.0 wrapt==1.16.0 diff --git a/tox.ini b/tox.ini index 1980dc18b51..c766a20ff54 100644 --- a/tox.ini +++ b/tox.ini @@ -91,13 +91,8 @@ envlist = [testenv] deps = - -c dev-requirements.txt - opentelemetry: pytest - opentelemetry: pytest-benchmark - opentelemetry: flaky coverage: pytest coverage: pytest-cov - mypy,mypyinstalled: mypy ; proto 3 and 4 tests install the respective version of protobuf proto3: protobuf~=3.19.0 @@ -113,6 +108,8 @@ setenv = commands_pre = + mypy,mypyinstalled: pip install -r {toxinidir}/mypy-requirements.txt + api: pip install -r {toxinidir}/opentelemetry-api/test-requirements.txt sdk: pip install -r {toxinidir}/opentelemetry-sdk/test-requirements.txt