From 31d350ce0c7fb0e175af5fd944f2572d525e8c70 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 28 Feb 2024 17:56:50 -0600 Subject: [PATCH] Remove [test] package from sqlalchemy instrumentation Fixes #2219 --- .../pyproject.toml | 5 ----- .../test-requirements-0.txt | 22 +++++++++++++++++++ .../test-requirements-1.txt | 20 +++++++++++++++++ tox.ini | 20 +++++++++-------- 4 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 1c63d671b7..bf5759e57b 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -35,11 +35,6 @@ dependencies = [ instruments = [ "sqlalchemy", ] -test = [ - "opentelemetry-instrumentation-sqlalchemy[instruments]", - "opentelemetry-sdk ~= 1.12", - "pytest", -] [project.entry-points.opentelemetry_instrumentor] sqlalchemy = "opentelemetry.instrumentation.sqlalchemy:SQLAlchemyInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt new file mode 100644 index 0000000000..26fd283824 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +cffi==1.15.1 +Deprecated==1.2.14 +greenlet==0.4.13 +hpy==0.0.4.dev179+g9b5d200 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +readline==6.2.4.1 +SQLAlchemy==1.1.18 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-sqlalchemy diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt new file mode 100644 index 0000000000..bfb9dac972 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt @@ -0,0 +1,20 @@ +aiosqlite==0.20.0 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +greenlet==3.0.3 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +SQLAlchemy==1.4.51 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-sqlalchemy diff --git a/tox.ini b/tox.ini index 820ac93816..23f5020381 100644 --- a/tox.ini +++ b/tox.ini @@ -172,8 +172,12 @@ envlist = pypy3-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy - py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} - pypy3-test-instrumentation-sqlalchemy-{11,14} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: sqlalchemy>=1.1,<1.2 aiosqlite + ; 1: sqlalchemy~=1.4 + py3{8,9,10,11}-test-instrumentation-sqlalchemy-{1} + pypy3-test-instrumentation-sqlalchemy-{0,1} ; opentelemetry-instrumentation-redis py3{8,9,10,11}-test-instrumentation-redis @@ -279,9 +283,6 @@ deps = flask-300: Flask >=3.0.0 flask-300: Werkzeug >=3.0.0 grpc: pytest-asyncio - sqlalchemy-11: sqlalchemy>=1.1,<1.2 - sqlalchemy-14: aiosqlite - sqlalchemy-14: sqlalchemy~=1.4 sio-pika-0: pika>=0.12.0,<1.0.0 sio-pika-1: pika>=1.0.0 aio-pika-7: aio_pika~=7.2.0 @@ -349,7 +350,7 @@ changedir = test-instrumentation-remoulade: instrumentation/opentelemetry-instrumentation-remoulade/tests test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests test-instrumentation-sklearn: instrumentation/opentelemetry-instrumentation-sklearn/tests - test-instrumentation-sqlalchemy-{11,14}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests + test-instrumentation-sqlalchemy-{0,1}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests @@ -472,7 +473,8 @@ commands_pre = sklearn: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] - sqlalchemy-{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + sqlalchemy-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt + sqlalchemy-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] @@ -548,7 +550,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] @@ -613,7 +615,7 @@ deps = psycopg ~= 3.1.17 psycopg2 ~= 2.9.5 aiopg >= 0.13.0, < 1.3.0 - sqlalchemy ~= 1.4 + sqlalchemy==1.4.51 redis ~= 4.3 celery[pytest] >= 4.0, < 6.0 protobuf~=3.13