From 6af918b08bb5c3b16eaf48d494abe8a23aef2ec4 Mon Sep 17 00:00:00 2001
From: Diego Hurtado <ocelotl@users.noreply.github.com>
Date: Thu, 14 Mar 2024 17:56:59 -0600
Subject: [PATCH] Remove [test] package from
 opentelemetry-exporter-otlp-proto-http (#3742)

Fixes #3723

Co-authored-by: Leighton Chen <lechen@microsoft.com>
---
 .../pyproject.toml                            |  5 ---
 .../test-requirements-0.txt                   | 31 +++++++++++++++++++
 .../test-requirements-1.txt                   | 31 +++++++++++++++++++
 tox.ini                                       |  7 ++---
 4 files changed, 65 insertions(+), 9 deletions(-)
 create mode 100644 exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt
 create mode 100644 exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt

diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml b/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml
index 95a613f6ef1..77a3bcb95b8 100644
--- a/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml
+++ b/exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml
@@ -33,11 +33,6 @@ dependencies = [
   "requests ~= 2.7",
 ]
 
-[project.optional-dependencies]
-test = [
-  "responses >= 0.22.0, < 0.25",
-]
-
 [project.entry-points.opentelemetry_traces_exporter]
 otlp_proto_http = "opentelemetry.exporter.otlp.proto.http.trace_exporter:OTLPSpanExporter"
 
diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt
new file mode 100644
index 00000000000..0faf2626687
--- /dev/null
+++ b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt
@@ -0,0 +1,31 @@
+asgiref==3.7.2
+attrs==23.2.0
+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.6
+importlib-metadata==6.11.0
+iniconfig==2.0.0
+packaging==23.2
+pluggy==1.4.0
+protobuf==3.19.6
+py==1.11.0
+py-cpuinfo==9.0.0
+pytest==7.1.3
+pytest-benchmark==4.0.0
+PyYAML==6.0.1
+requests==2.31.0
+responses==0.24.1
+tomli==2.0.1
+typing_extensions==4.10.0
+urllib3==2.2.1
+wrapt==1.16.0
+zipp==3.17.0
+-e opentelemetry-api
+-e exporter/opentelemetry-exporter-otlp-proto-common
+-e opentelemetry-proto
+-e opentelemetry-sdk
+-e opentelemetry-semantic-conventions
+-e exporter/opentelemetry-exporter-otlp-proto-http
diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt
new file mode 100644
index 00000000000..d38b38f1c40
--- /dev/null
+++ b/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt
@@ -0,0 +1,31 @@
+asgiref==3.7.2
+attrs==23.2.0
+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.6
+importlib-metadata==6.11.0
+iniconfig==2.0.0
+packaging==23.2
+pluggy==1.4.0
+protobuf==4.25.3
+py==1.11.0
+py-cpuinfo==9.0.0
+pytest==7.1.3
+pytest-benchmark==4.0.0
+PyYAML==6.0.1
+requests==2.31.0
+responses==0.24.1
+tomli==2.0.1
+typing_extensions==4.10.0
+urllib3==2.2.1
+wrapt==1.16.0
+zipp==3.17.0
+-e opentelemetry-api
+-e exporter/opentelemetry-exporter-otlp-proto-common
+-e opentelemetry-proto
+-e opentelemetry-sdk
+-e opentelemetry-semantic-conventions
+-e exporter/opentelemetry-exporter-otlp-proto-http
diff --git a/tox.ini b/tox.ini
index 44617a02fa2..18b552ea8cd 100644
--- a/tox.ini
+++ b/tox.ini
@@ -131,9 +131,8 @@ commands_pre =
   exporter-otlp-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common
   exporter-otlp-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc
 
-  exporter-otlp-proto-http: pip install {toxinidir}/opentelemetry-proto
-  exporter-otlp-proto-http: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common
-  exporter-otlp-proto-http: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http[test]
+  proto3-opentelemetry-exporter-otlp-proto-http: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-0.txt
+  proto4-opentelemetry-exporter-otlp-proto-http: pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt
 
   opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
   opentracing-shim: pip install {toxinidir}/shim/opentelemetry-opentracing-shim
@@ -224,7 +223,7 @@ commands_pre =
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-opencensus[test]
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-common[test]
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc[test]
-  python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http[test]
+  pip install -r {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http/test-requirements-1.txt
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp[test]
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-prometheus[test]
   python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-zipkin-json[test]