Skip to content

Commit

Permalink
build: replace futures dependency by futures-util
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Perez committed Oct 29, 2023
1 parent a078c69 commit d915ca3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ unindent = { version = "0.2.1", optional = true }
inventory = { version = "0.3.0", optional = true }

# coroutine implementation
futures= "0.3"
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }

# crate integrations that can be added using the eponymous features
anyhow = { version = "1.0", optional = true }
Expand All @@ -58,6 +58,7 @@ serde_json = "1.0.61"
rayon = "1.0.2"
rust_decimal = { version = "1.8.0", features = ["std"] }
widestring = "0.5.1"
futures = "0.3.29"

[build-dependencies]
pyo3-build-config = { path = "pyo3-build-config", version = "0.20.0", features = ["resolve-config"] }
Expand Down
2 changes: 1 addition & 1 deletion src/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Coroutine {
} else {
self.waker = Some(Arc::new(AsyncioWaker::new()));
}
let waker = futures::task::waker(self.waker.clone().unwrap());
let waker = futures_util::task::waker(self.waker.clone().unwrap());
// poll the Rust future and forward its results if ready
if let Poll::Ready(res) = future_rs.as_mut().poll(&mut Context::from_waker(&waker)) {
self.close();
Expand Down
4 changes: 2 additions & 2 deletions src/coroutine/cancel.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{ffi, Py, PyObject, Python};
use futures::future::poll_fn;
use futures::task::AtomicWaker;
use futures_util::future::poll_fn;
use futures_util::task::AtomicWaker;
use std::ptr;
use std::sync::atomic::{AtomicPtr, Ordering};
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion src/coroutine/waker.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::sync::GILOnceCell;
use crate::types::PyCFunction;
use crate::{intern, wrap_pyfunction, Py, PyAny, PyObject, PyResult, Python};
use futures::task::ArcWake;
use futures_util::task::ArcWake;
use pyo3_macros::pyfunction;
use std::sync::Arc;

Expand Down

0 comments on commit d915ca3

Please sign in to comment.