File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ axum = "0.7"
3131criterion = " 0.5"
3232futures = " 0.3"
3333http-types = " 2"
34- pyo3 = " 0.22 "
34+ pyo3 = " 0.27 "
3535quickcheck = " 1"
3636rand = " 0.8.4"
3737tide = " 0.16"
Original file line number Diff line number Diff line change @@ -1251,21 +1251,21 @@ mod tests {
12511251 }
12521252
12531253 fn parse_with_python_client ( input : String ) {
1254- pyo3:: prepare_freethreaded_python ( ) ;
1254+ pyo3:: Python :: initialize ( ) ;
12551255
12561256 println ! ( "{input:?}" ) ;
1257- Python :: with_gil ( |py| {
1258- let parser = PyModule :: from_code_bound (
1257+ Python :: attach ( |py| {
1258+ let parser = PyModule :: from_code (
12591259 py,
1260- r# "
1260+ c "
12611261from prometheus_client.openmetrics.parser import text_string_to_metric_families
12621262
12631263def parse(input):
12641264 families = text_string_to_metric_families(input)
12651265 list(families)
1266- "# ,
1267- "parser.py" ,
1268- "parser" ,
1266+ " ,
1267+ c "parser.py",
1268+ c "parser",
12691269 )
12701270 . map_err ( |e| e. to_string ( ) )
12711271 . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ mod tests {
265265 // Map infinite, subnormal and NaN to 0.0.
266266 . map ( |f| if f. is_normal ( ) { f } else { 0.0 } )
267267 . collect ( ) ;
268- let sum = fs. iter ( ) . sum ( ) ;
268+ let sum: f64 = fs. iter ( ) . sum ( ) ;
269269 let counter = Counter :: < f64 , AtomicU64 > :: default ( ) ;
270270 for f in fs {
271271 counter. inc_by ( f) ;
You can’t perform that action at this time.
0 commit comments