From 2e28345ba0d19a01cdba181252863a6885e6dc63 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 28 Feb 2024 17:41:40 -0600 Subject: [PATCH] Remove [test] package from httpx instrumentation Fixes #2203 --- .../pyproject.toml | 5 ---- .../test-requirements-0.txt | 28 +++++++++++++++++++ .../test-requirements-1.txt | 27 ++++++++++++++++++ tox.ini | 21 +++++++------- 4 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index f13fa816bc..1a4da4a520 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "httpx >= 0.18.0", ] -test = [ - "opentelemetry-instrumentation-httpx[instruments]", - "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] httpx = "opentelemetry.instrumentation.httpx:HTTPXClientInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt new file mode 100644 index 0000000000..2d3a8399d8 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt @@ -0,0 +1,28 @@ +anyio==3.7.1 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +h11==0.12.0 +httpcore==0.13.7 +httpx==0.18.2 +idna==3.6 +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 +respx==0.17.1 +rfc3986==1.5.0 +sniffio==1.3.1 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-httpx diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt new file mode 100644 index 0000000000..4a36398fc1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt @@ -0,0 +1,27 @@ +anyio==4.3.0 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +h11==0.14.0 +httpcore==1.0.4 +httpx==0.27.0 +idna==3.6 +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 +respx==0.20.2 +sniffio==1.3.1 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-httpx diff --git a/tox.ini b/tox.ini index 820ac93816..23106b0f34 100644 --- a/tox.ini +++ b/tox.ini @@ -203,8 +203,8 @@ envlist = pypy3-test-instrumentation-tortoiseorm ; opentelemetry-instrumentation-httpx - py3{8,9,10,11}-test-instrumentation-httpx-{18,21} - pypy3-test-instrumentation-httpx-{18,21} + py3{8,9,10,11}-test-instrumentation-httpx-{0,1} + pypy3-test-instrumentation-httpx-{0,1} ; opentelemetry-util-http py3{8,9,10,11}-test-util-http @@ -292,10 +292,6 @@ deps = pymemcache-300: pymemcache >3.0.0,<3.4.2 pymemcache-342: pymemcache ==3.4.2 pymemcache-400: pymemcache ==4.0.0 - httpx-18: httpx>=0.18.0,<0.19.0 - httpx-18: respx~=0.17.0 - httpx-21: httpx>=0.19.0 - httpx-21: respx~=0.20.1 urllib3v-1: urllib3 >=1.0.0,<2.0.0 urllib3v-2: urllib3 >=2.0.0,<3.0.0 @@ -356,7 +352,7 @@ changedir = test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests test-instrumentation-tortoiseorm: instrumentation/opentelemetry-instrumentation-tortoiseorm/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests - test-instrumentation-httpx-{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests + test-instrumentation-httpx-{0,1}: instrumentation/opentelemetry-instrumentation-httpx/tests test-instrumentation-asyncio: instrumentation/opentelemetry-instrumentation-asyncio/tests test-util-http: util/opentelemetry-util-http/tests test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests @@ -391,7 +387,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http wsgi,falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] asgi,django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] @@ -478,7 +474,12 @@ commands_pre = asyncio: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test] - httpx-{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: httpx>=0.18.0,<0.19.0 respx~=0.17.0 + ; 1: httpx>=0.19.0 respx~=0.20.1 + httpx-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt + httpx-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] @@ -582,7 +583,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test]