File tree 3 files changed +26
-7
lines changed
opentelemetry-instrumentation
src/opentelemetry/instrumentation
3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
32
32
33
33
- ` opentelemetry-instrumentation-httpx ` Fix ` RequestInfo ` /` ResponseInfo ` type hints
34
34
([ #3105 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3105 ) )
35
+ - ` opentelemetry-instrumentation ` Fix ` get_dist_dependency_conflicts ` if no distribution requires
36
+ ([ #3168 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3168 ) )
35
37
36
38
37
39
## Version 1.29.0/0.50b0 (2024-12-11)
Original file line number Diff line number Diff line change @@ -47,13 +47,14 @@ def get_dist_dependency_conflicts(
47
47
extra = "extra"
48
48
instruments = "instruments"
49
49
instruments_marker = {extra : instruments }
50
- for dep in dist .requires :
51
- if extra not in dep or instruments not in dep :
52
- continue
53
-
54
- req = Requirement (dep )
55
- if req .marker .evaluate (instruments_marker ):
56
- instrumentation_deps .append (req )
50
+ if dist .requires :
51
+ for dep in dist .requires :
52
+ if extra not in dep or instruments not in dep :
53
+ continue
54
+
55
+ req = Requirement (dep )
56
+ if req .marker .evaluate (instruments_marker ):
57
+ instrumentation_deps .append (req )
57
58
58
59
return get_dependency_conflicts (instrumentation_deps )
59
60
Original file line number Diff line number Diff line change @@ -86,3 +86,19 @@ def requires(self):
86
86
str (conflict ),
87
87
'DependencyConflict: requested: "test-pkg~=1.0; extra == "instruments"" but found: "None"' ,
88
88
)
89
+
90
+ def test_get_dist_dependency_conflicts_requires_none (self ):
91
+ class MockDistribution (Distribution ):
92
+ def locate_file (self , path ):
93
+ pass
94
+
95
+ def read_text (self , filename ):
96
+ pass
97
+
98
+ @property
99
+ def requires (self ):
100
+ return None
101
+
102
+ dist = MockDistribution ()
103
+ conflict = get_dist_dependency_conflicts (dist )
104
+ self .assertTrue (conflict is None )
You can’t perform that action at this time.
0 commit comments