File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed
opentelemetry-instrumentation
src/opentelemetry/instrumentation Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434 ([ #3105 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3105 ) )
3535- ` opentelemetry-instrumentation-click ` Disable tracing of well-known server click commands
3636 ([ #3174 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3174 ) )
37+ - ` opentelemetry-instrumentation ` Fix ` get_dist_dependency_conflicts ` if no distribution requires
38+ ([ #3168 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3168 ) )
3739
3840
3941## 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(
4747 extra = "extra"
4848 instruments = "instruments"
4949 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 )
5758
5859 return get_dependency_conflicts (instrumentation_deps )
5960
Original file line number Diff line number Diff line change @@ -86,3 +86,19 @@ def requires(self):
8686 str (conflict ),
8787 'DependencyConflict: requested: "test-pkg~=1.0; extra == "instruments"" but found: "None"' ,
8888 )
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