Skip to content

Commit d915ca3

Browse files
author
Joseph Perez
committed
build: replace futures dependency by futures-util
1 parent a078c69 commit d915ca3

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ unindent = { version = "0.2.1", optional = true }
3232
inventory = { version = "0.3.0", optional = true }
3333

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

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

6263
[build-dependencies]
6364
pyo3-build-config = { path = "pyo3-build-config", version = "0.20.0", features = ["resolve-config"] }

src/coroutine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Coroutine {
102102
} else {
103103
self.waker = Some(Arc::new(AsyncioWaker::new()));
104104
}
105-
let waker = futures::task::waker(self.waker.clone().unwrap());
105+
let waker = futures_util::task::waker(self.waker.clone().unwrap());
106106
// poll the Rust future and forward its results if ready
107107
if let Poll::Ready(res) = future_rs.as_mut().poll(&mut Context::from_waker(&waker)) {
108108
self.close();

src/coroutine/cancel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{ffi, Py, PyObject, Python};
2-
use futures::future::poll_fn;
3-
use futures::task::AtomicWaker;
2+
use futures_util::future::poll_fn;
3+
use futures_util::task::AtomicWaker;
44
use std::ptr;
55
use std::sync::atomic::{AtomicPtr, Ordering};
66
use std::sync::Arc;

src/coroutine/waker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::sync::GILOnceCell;
22
use crate::types::PyCFunction;
33
use crate::{intern, wrap_pyfunction, Py, PyAny, PyObject, PyResult, Python};
4-
use futures::task::ArcWake;
4+
use futures_util::task::ArcWake;
55
use pyo3_macros::pyfunction;
66
use std::sync::Arc;
77

0 commit comments

Comments
 (0)