Skip to content

Commit 76e54ce

Browse files
blarghmateyCopilot
andcommitted
Fix CI failures: ruff formatting and lint wrapt version pin
- utils.py: reformat multi-condition if statement to satisfy ruff line length requirement (fixes generate/precommit CI jobs) - tox.ini: pin wrapt>=1.0.0,<2.0.0 for lint envs of botocore, dbapi, grpc, and sio-pika; with wrapt 1.x removed from base test-requirements, lint envs were getting wrapt 2.x which caused pylint no-member errors on __wrapped__ (a C-extension attribute not visible to static analysis) Also add Deprecated==1.2.14 to same lint envs for consistency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1d4bc74 commit 76e54ce

File tree

2 files changed

+13
-1
lines changed
  • opentelemetry-instrumentation/src/opentelemetry/instrumentation

2 files changed

+13
-1
lines changed

opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ def unwrap(obj: object, attr: str):
111111
) from exc
112112

113113
func = getattr(obj, attr, None)
114-
if func and isinstance(func, BaseObjectProxy) and hasattr(func, "__wrapped__"):
114+
if (
115+
func
116+
and isinstance(func, BaseObjectProxy)
117+
and hasattr(func, "__wrapped__")
118+
):
115119
setattr(obj, attr, func.__wrapped__)
116120

117121

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ deps =
528528
sio-pika-1-wrapt1: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1-wrapt1.txt
529529
sio-pika-1-wrapt2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1-wrapt2.txt
530530
lint-instrumentation-sio-pika: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt
531+
lint-instrumentation-sio-pika: Deprecated==1.2.14
532+
lint-instrumentation-sio-pika: wrapt>=1.0.0,<2.0.0
531533

532534
aio-pika: {[testenv]test_deps}
533535
aio-pika-0: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt
@@ -554,6 +556,8 @@ deps =
554556
grpc-1-wrapt1: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1-wrapt1.txt
555557
grpc-1-wrapt2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1-wrapt2.txt
556558
lint-instrumentation-grpc: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements-1.txt
559+
lint-instrumentation-grpc: Deprecated==1.2.14
560+
lint-instrumentation-grpc: wrapt>=1.0.0,<2.0.0
557561

558562
wsgi: {[testenv]test_deps}
559563
wsgi: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt
@@ -601,6 +605,8 @@ deps =
601605
botocore-1-wrapt1: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-1-wrapt1.txt
602606
botocore-1-wrapt2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-1-wrapt2.txt
603607
lint-instrumentation-botocore: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements-1.txt
608+
lint-instrumentation-botocore: Deprecated==1.2.14
609+
lint-instrumentation-botocore: wrapt>=1.0.0,<2.0.0
604610

605611
cassandra: {[testenv]test_deps}
606612
cassandra-driver: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt
@@ -611,6 +617,8 @@ deps =
611617
dbapi-wrapt1: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements-wrapt1.txt
612618
dbapi-wrapt2: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements-wrapt2.txt
613619
lint-instrumentation-dbapi: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt
620+
lint-instrumentation-dbapi: Deprecated==1.2.14
621+
lint-instrumentation-dbapi: wrapt>=1.0.0,<2.0.0
614622

615623
django: {[testenv]test_deps}
616624
py3{9}-test-instrumentation-django-0: -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt

0 commit comments

Comments
 (0)