Skip to content

Commit 1731b8e

Browse files
authored
deps: update to pyo3 0.27 (#290)
Signed-off-by: Max Leonard Inden <[email protected]>
1 parent 82ab3c4 commit 1731b8e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ axum = "0.7"
3131
criterion = "0.5"
3232
futures = "0.3"
3333
http-types = "2"
34-
pyo3 = "0.22"
34+
pyo3 = "0.27"
3535
quickcheck = "1"
3636
rand = "0.8.4"
3737
tide = "0.16"

src/encoding/text.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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"
12611261
from prometheus_client.openmetrics.parser import text_string_to_metric_families
12621262
12631263
def 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();

src/metrics/counter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)