Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ axum = "0.7"
criterion = "0.5"
futures = "0.3"
http-types = "2"
pyo3 = "0.22"
pyo3 = "0.27"
quickcheck = "1"
rand = "0.8.4"
tide = "0.16"
Expand Down
14 changes: 7 additions & 7 deletions src/encoding/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,21 +1251,21 @@ mod tests {
}

fn parse_with_python_client(input: String) {
pyo3::prepare_freethreaded_python();
pyo3::Python::initialize();

println!("{input:?}");
Python::with_gil(|py| {
let parser = PyModule::from_code_bound(
Python::attach(|py| {
let parser = PyModule::from_code(
py,
r#"
c"
from prometheus_client.openmetrics.parser import text_string_to_metric_families

def parse(input):
families = text_string_to_metric_families(input)
list(families)
"#,
"parser.py",
"parser",
",
c"parser.py",
c"parser",
)
.map_err(|e| e.to_string())
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ mod tests {
// Map infinite, subnormal and NaN to 0.0.
.map(|f| if f.is_normal() { f } else { 0.0 })
.collect();
let sum = fs.iter().sum();
let sum: f64 = fs.iter().sum();
let counter = Counter::<f64, AtomicU64>::default();
for f in fs {
counter.inc_by(f);
Expand Down
Loading