Skip to content

Commit

Permalink
Merge pull request #24 from clitic/update_pyo3
Browse files Browse the repository at this point in the history
bump pyo3 to version 0.23
  • Loading branch information
clitic authored Dec 10, 2024
2 parents 2c5030d + 3129b55 commit b72aa1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion kdam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version = "0.6.1"
colorgrad = { version = "0.7", optional = true }
formatx = { version = "0.2.2", optional = true }
kdam_derive = { version = "0.1.0", path = "../kdam_derive", optional = true }
pyo3 = { version = "0.22", optional = true }
pyo3 = { version = "0.23", optional = true }
rayon = { version = "1.10", optional = true }
terminal_size = "0.4"
unicode-segmentation = { version = "1", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions kdam/examples/notebook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ crate-type = ["cdylib"]

[dependencies]
kdam = { path = "../..", features = ["notebook", "template"] }
pyo3 = { version = "0.22", features = ["extension-module"] }
pyo3 = { version = "0.23", features = ["extension-module"] }

[build-dependencies]
pyo3-build-config = "0.22"
pyo3-build-config = "0.23"
10 changes: 5 additions & 5 deletions kdam/src/std/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,15 +1002,15 @@ impl BarBuilder {
#[cfg(feature = "notebook")]
if notebook::running() {
Python::with_gil(|py| -> PyResult<()> {
let ipywidgets = PyModule::import_bound(py, "ipywidgets")?;
let ipython_display = PyModule::import_bound(py, "IPython.display")?;
let ipywidgets = PyModule::import(py, "ipywidgets")?;
let ipython_display = PyModule::import(py, "IPython.display")?;

let int_progress = ipywidgets.getattr("IntProgress")?;
let hbox = ipywidgets.getattr("HBox")?;
let html = ipywidgets.getattr("HTML")?;
let display = ipython_display.getattr("display")?;

let kwargs = PyDict::new_bound(py);
let kwargs = PyDict::new(py);
kwargs.set_item("min", 0)?;

if self.pb.total == 0 {
Expand All @@ -1021,7 +1021,7 @@ impl BarBuilder {
}

if let Some(Colour::Solid(colour)) = &self.pb.colour {
let style = PyDict::new_bound(py);
let style = PyDict::new(py);
style.set_item("bar_color", colour)?;
kwargs.set_item("style", style)?;
}
Expand All @@ -1033,7 +1033,7 @@ impl BarBuilder {
layout.setattr("flex", "2")?;
}

let kwargs = PyDict::new_bound(py);
let kwargs = PyDict::new(py);
kwargs.set_item("children", [html.call0()?, pb, html.call0()?])?;

let container = hbox.call((), Some(&kwargs))?;
Expand Down

0 comments on commit b72aa1e

Please sign in to comment.