Skip to content

Commit 069e808

Browse files
committed
Fix requirements to work with python 3.8
1 parent 88fd4bc commit 069e808

File tree

6 files changed

+51
-45
lines changed

6 files changed

+51
-45
lines changed

instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/test-requirements-0.txt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,36 @@ annotated-types==0.7.0
22
cachetools==5.5.0
33
certifi==2024.8.30
44
charset-normalizer==3.4.0
5-
Deprecated==1.2.15
5+
Deprecated==1.2.14
66
docstring_parser==0.16
7+
exceptiongroup==1.2.2
78
google-api-core==2.23.0
89
google-auth==2.36.0
9-
google-cloud-aiplatform==1.73.0
10+
google-cloud-aiplatform==1.74.0
1011
google-cloud-bigquery==3.27.0
1112
google-cloud-core==2.4.1
1213
google-cloud-resource-manager==1.13.1
13-
google-cloud-storage==2.18.2
14-
google-crc32c==1.6.0
14+
google-cloud-storage==2.19.0
15+
google-crc32c==1.5.0
1516
google-resumable-media==2.7.2
1617
googleapis-common-protos==1.66.0
1718
grpc-google-iam-v1==0.13.1
18-
grpcio==1.68.0
19-
grpcio-status==1.68.0
19+
grpcio==1.68.1
20+
grpcio-status==1.68.1
2021
idna==3.10
21-
importlib_metadata==8.5.0
22+
importlib-metadata==6.11.0
2223
iniconfig==2.0.0
2324
multidict==6.1.0
24-
numpy==2.1.3
25-
packaging==24.2
25+
numpy==1.24.4
26+
packaging==24.0
2627
pluggy==1.5.0
2728
propcache==0.2.0
2829
proto-plus==1.25.0
29-
protobuf==5.28.3
30+
protobuf==5.29.1
3031
pyasn1==0.6.1
3132
pyasn1_modules==0.4.1
32-
pydantic==2.10.1
33-
pydantic_core==2.27.1
33+
pydantic==2.8.2
34+
pydantic_core==2.20.1
3435
pytest==7.4.4
3536
pytest-asyncio==0.21.0
3637
pytest-vcr==1.0.2
@@ -39,13 +40,14 @@ PyYAML==6.0.2
3940
requests==2.32.3
4041
rsa==4.9
4142
shapely==2.0.6
42-
six==1.16.0
43+
six==1.17.0
44+
tomli==2.2.1
4345
typing_extensions==4.12.2
44-
urllib3==2.2.3
46+
urllib3==1.26.20
4547
vcrpy==6.0.2
46-
wrapt==1.17.0
47-
yarl==1.18.0
48-
zipp==3.21.0
48+
wrapt==1.16.0
49+
yarl==1.15.2
50+
zipp==3.20.2
4951

5052
# when updating, also update in pyproject.toml
5153
opentelemetry-api==1.28

instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/test-requirements-1.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
annotated-types==0.7.0
2+
asgiref==3.8.1
23
cachetools==5.5.0
34
certifi==2024.8.30
45
charset-normalizer==3.4.0
56
Deprecated==1.2.15
67
docstring_parser==0.16
8+
exceptiongroup==1.2.2
79
google-api-core==2.23.0
810
google-auth==2.36.0
9-
google-cloud-aiplatform==1.73.0
11+
google-cloud-aiplatform==1.74.0
1012
google-cloud-bigquery==3.27.0
1113
google-cloud-core==2.4.1
1214
google-cloud-resource-manager==1.13.1
13-
google-cloud-storage==2.18.2
14-
google-crc32c==1.6.0
15+
google-cloud-storage==2.19.0
16+
google-crc32c==1.5.0
1517
google-resumable-media==2.7.2
1618
googleapis-common-protos==1.66.0
1719
grpc-google-iam-v1==0.13.1
18-
grpcio==1.68.0
19-
grpcio-status==1.68.0
20+
grpcio==1.68.1
21+
grpcio-status==1.68.1
2022
idna==3.10
2123
importlib_metadata==8.5.0
2224
iniconfig==2.0.0
2325
multidict==6.1.0
24-
numpy==2.1.3
26+
numpy==1.24.4
2527
packaging==24.2
2628
pluggy==1.5.0
2729
propcache==0.2.0
2830
proto-plus==1.25.0
29-
protobuf==5.28.3
31+
protobuf==5.29.1
3032
pyasn1==0.6.1
3133
pyasn1_modules==0.4.1
32-
pydantic==2.10.1
34+
pydantic==2.10.3
3335
pydantic_core==2.27.1
3436
pytest==7.4.4
3537
pytest-asyncio==0.21.0
@@ -39,13 +41,14 @@ PyYAML==6.0.2
3941
requests==2.32.3
4042
rsa==4.9
4143
shapely==2.0.6
42-
six==1.16.0
44+
six==1.17.0
45+
tomli==2.2.1
4346
typing_extensions==4.12.2
44-
urllib3==2.2.3
47+
urllib3==1.26.20
4548
vcrpy==6.0.2
4649
wrapt==1.17.0
47-
yarl==1.18.0
48-
zipp==3.21.0
50+
yarl==1.15.2
51+
zipp==3.20.2
4952
# test with the latest version of opentelemetry-api, sdk, and semantic conventions
5053

5154
-e opentelemetry-instrumentation

instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/tests/cassettes/test_vertexai_generate_content.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,25 @@ interactions:
2424
body:
2525
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"role\":
2626
\"model\",\n \"parts\": [\n {\n \"text\": \" The
27-
image shows a table with a cup of coffee, a bowl of blueberries, and several
28-
blueberry scones. There are also pink flowers on the table.\"\n }\n
29-
\ ]\n },\n \"finishReason\": 1,\n \"safetyRatings\":
27+
image shows a table with a cup of coffee, a bowl of blueberries, and a plate
28+
of scones with blueberries on it. There are also pink flowers on the table.\"\n
29+
\ }\n ]\n },\n \"finishReason\": 1,\n \"safetyRatings\":
3030
[\n {\n \"category\": 1,\n \"probability\": 1,\n
31-
\ \"probabilityScore\": 0.024780273,\n \"severity\": 1,\n
31+
\ \"probabilityScore\": 0.02758789,\n \"severity\": 1,\n
3232
\ \"severityScore\": 0.072753906\n },\n {\n \"category\":
33-
2,\n \"probability\": 1,\n \"probabilityScore\": 0.025512695,\n
34-
\ \"severity\": 1,\n \"severityScore\": 0.06738281\n },\n
33+
2,\n \"probability\": 1,\n \"probabilityScore\": 0.026000977,\n
34+
\ \"severity\": 1,\n \"severityScore\": 0.07080078\n },\n
3535
\ {\n \"category\": 3,\n \"probability\": 1,\n \"probabilityScore\":
36-
0.040283203,\n \"severity\": 1,\n \"severityScore\": 0.03515625\n
36+
0.04272461,\n \"severity\": 1,\n \"severityScore\": 0.036865234\n
3737
\ },\n {\n \"category\": 4,\n \"probability\":
38-
1,\n \"probabilityScore\": 0.07910156,\n \"severity\": 1,\n
39-
\ \"severityScore\": 0.083984375\n }\n ],\n \"avgLogprobs\":
40-
-0.068832365671793613\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
41-
265,\n \"candidatesTokenCount\": 30,\n \"totalTokenCount\": 295\n },\n
38+
1,\n \"probabilityScore\": 0.08496094,\n \"severity\": 1,\n
39+
\ \"severityScore\": 0.09033203\n }\n ],\n \"avgLogprobs\":
40+
-0.09576562472752162\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
41+
265,\n \"candidatesTokenCount\": 35,\n \"totalTokenCount\": 300\n },\n
4242
\ \"modelVersion\": \"gemini-pro-vision\"\n}\n"
4343
headers:
4444
Cache-Control:
4545
- private
46-
Content-Encoding:
47-
- gzip
4846
Content-Type:
4947
- application/json; charset=UTF-8
5048
Transfer-Encoding:
@@ -53,6 +51,8 @@ interactions:
5351
- Origin
5452
- X-Origin
5553
- Referer
54+
content-length:
55+
- '1296'
5656
status:
5757
code: 200
5858
message: OK

instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def before_response_cb(response: MutableMapping[str, Any]):
9090
return response
9191

9292
return {
93+
"decode_compressed_response": True,
9394
"before_record_request": before_record_cb,
9495
"before_record_response": before_response_cb,
9596
"ignore_hosts": ["oauth2.googleapis.com"],

instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/tests/test_gemini.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def test_vertexai_generate_content(exporter):
2525
vertexai_span = spans[0]
2626
assert len(spans) == 1
2727

28-
assert vertexai_span.attributes == {
28+
assert dict(vertexai_span.attributes) == {
2929
"gen_ai.system": "vertex_ai",
3030
"gen_ai.operation.name": "text_completion",
3131
"gen_ai.request.model": "gemini-pro-vision",
3232
"gen_ai.response.model": "gemini-pro-vision",
33-
"gen_ai.usage.output_tokens": 30,
33+
"gen_ai.usage.output_tokens": 35,
3434
"gen_ai.usage.input_tokens": 265,
3535
}
3636

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ commands =
960960
test-instrumentation-openai-v2: pytest {toxinidir}/instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests {posargs}
961961
lint-instrumentation-openai-v2: sh -c "cd instrumentation-genai && pylint --rcfile ../.pylintrc opentelemetry-instrumentation-openai-v2"
962962

963-
test-instrumentation-vertexai-v2: pytest {toxinidir}/instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/tests {posargs}
963+
test-instrumentation-vertexai-v2: pytest {toxinidir}/instrumentation-genai/opentelemetry-instrumentation-vertexai-v2/tests --vcr-record=none {posargs}
964964
lint-instrumentation-vertexai-v2: sh -c "cd instrumentation-genai && pylint --rcfile ../.pylintrc opentelemetry-instrumentation-vertexai-v2"
965965

966966
test-instrumentation-sio-pika: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/tests {posargs}

0 commit comments

Comments
 (0)