Skip to content

Commit a9c7ea9

Browse files
committed
lint. Still needs to be simplified
1 parent fa61bb2 commit a9c7ea9

File tree

1 file changed

+10
-7
lines changed
  • opentelemetry-instrumentation/src/opentelemetry/instrumentation

1 file changed

+10
-7
lines changed

opentelemetry-instrumentation/src/opentelemetry/instrumentation/dependencies.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ def __init__(
4242
self,
4343
required: str | None = None,
4444
found: str | None = None,
45-
required_either: Collection[str] = [],
46-
found_either: Collection[str] = [],
45+
# TODO: dangerous
46+
# TODO: dangerous
47+
required_either: Collection[str] = None,
48+
found_either: Collection[str] = None,
4749
):
4850
self.required = required
4951
self.found = found
@@ -129,7 +131,8 @@ def get_dependency_conflicts(
129131
], # Dependenciesall of which are required
130132
deps_either: Collection[
131133
str | Requirement
132-
] = [], # Dependencies any of which are required
134+
# TODO: dangerous
135+
] = None, # Dependencies any of which are required
133136
) -> DependencyConflict | None:
134137
for dep in deps:
135138
# TODO: what is this?
@@ -191,12 +194,12 @@ def get_dependency_conflicts(
191194
continue
192195

193196
if req.specifier.contains(dist_version):
194-
is_dependency_conflict = False
195197
# Since only one of the instrumentation_either dependencies is required, there is no dependency conflict.
198+
is_dependency_conflict = False
196199
break
197-
else:
198-
required_either.append(str(dep))
199-
found_either.append(f"{req.name} {dist_version}")
200+
# If the version does not match, add it to the list of unfulfilled requirement options.
201+
required_either.append(str(dep))
202+
found_either.append(f"{req.name} {dist_version}")
200203

201204
if is_dependency_conflict:
202205
# return DependencyConflict(dep, f"{req.name} {dist_version}")

0 commit comments

Comments
 (0)