Skip to content

Commit 4e18f54

Browse files
chore: Version bumps and package naming in CI and README (#9)
* Version bumps and package naming in CI and README * link * more naming. * Update README.md Co-authored-by: David Hewitt <[email protected]> * more links --------- Co-authored-by: David Hewitt <[email protected]>
1 parent 284bd36 commit 4e18f54

File tree

11 files changed

+69
-75
lines changed

11 files changed

+69
-75
lines changed

.github/issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When reporting a bug, please provide the following information. If this is not a
99
- How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?:
1010
- Your Rust version (`rustc --version`):
1111
- Your PyO3 version:
12-
- Have you tried using latest PyO3 master (replace `version = "0.x.y"` with `git = "https://github.com/awestlake87/pyo3-asyncio")?`:
12+
- Have you tried using latest PyO3 master (replace `version = "0.x.y"` with `git = "https://github.com/PyO3/pyo3-async-runtimes")?`:
1313

1414
### 💥 Reproducing
1515

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Thank you for contributing to pyo3-asyncio!
1+
Thank you for contributing to pyo3-async-runtimes!
22

33
Please consider adding the following to your pull request:
44
- an entry in CHANGELOG.md

.github/workflows/ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/setup-python@v4
2020
with:
2121
python-version: "3.10"
22-
- run: pip install black==22.8.0
22+
- run: pip install black==24.10.0
2323
- uses: dtolnay/rust-toolchain@stable
2424
with:
2525
toolchain: stable
@@ -49,13 +49,10 @@ jobs:
4949
rust: [stable]
5050
python-version:
5151
[
52-
"3.7",
53-
"3.8",
5452
"3.9",
5553
"3.10",
56-
"3.11-dev",
57-
"pypy-3.7",
58-
"pypy-3.8",
54+
"3.11",
55+
"3.12",
5956
"pypy-3.9",
6057
]
6158
platform:
@@ -83,10 +80,6 @@ jobs:
8380
]
8481
exclude:
8582
# PyPy doesn't release 32-bit Windows builds any more
86-
- python-version: pypy-3.7
87-
platform: { os: "windows-latest", python-architecture: "x86" }
88-
- python-version: pypy-3.8
89-
platform: { os: "windows-latest", python-architecture: "x86" }
9083
- python-version: pypy-3.9
9184
platform: { os: "windows-latest", python-architecture: "x86" }
9285
include:
@@ -103,7 +96,7 @@ jobs:
10396

10497
# Test the `nightly` feature
10598
- rust: nightly
106-
python-version: "3.10"
99+
python-version: "3.12"
107100
platform:
108101
{
109102
os: "ubuntu-latest",

.github/workflows/guide.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cargo doc --no-deps --all-features
2525
mkdir -p gh-pages-build
2626
cp -r target/doc gh-pages-build/doc
27-
echo "<meta http-equiv=refresh content=0;url=pyo3_asyncio/index.html>" > gh-pages-build/doc/index.html
27+
echo "<meta http-equiv=refresh content=0;url=pyo3_async_runtimes/index.html>" > gh-pages-build/doc/index.html
2828
2929
- name: Prepare tag
3030
id: prepare_tag

README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# PyO3 Asyncio
22

3-
[![Actions Status](https://github.com/davidhewitt/pyo3-asyncio/workflows/CI/badge.svg)](https://github.com/davidhewitt/pyo3-asyncio/actions)
4-
[![codecov](https://codecov.io/gh/davidhewitt/pyo3-asyncio/branch/master/graph/badge.svg)](https://codecov.io/gh/davidhewitt/pyo3-asyncio)
5-
[![crates.io](https://img.shields.io/crates/v/pyo3-asyncio-0-21)](https://crates.io/crates/pyo3-asyncio-0-21)
3+
[![Actions Status](https://github.com/PyO3/pyo3-async-runtimes/workflows/CI/badge.svg)](https://github.com/PyO3/pyo3-async-runtimes)
4+
[![codecov](https://codecov.io/gh/davidhewitt/pyo3-async-runtimes/branch/main/graph/badge.svg)](https://codecov.io/gh/PyO3/pyo3-async-runtimes)
5+
[![crates.io](https://img.shields.io/crates/v/pyo3-async-runtimes)](https://crates.io/crates/pyo3-async-runtimes)
66
[![minimum rustc 1.63](https://img.shields.io/badge/rustc-1.63+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
77

88
***This is a fork of [`pyo3-asyncio`](https://github.com/awestlake87/pyo3-asyncio/) to deliver compatibility for PyO3 0.21. This may be the base for a permanent fork in the future, depending on the status of the original `pyo3-asyncio` maintainer.***
@@ -11,11 +11,11 @@
1111

1212
- PyO3 Project: [Homepage](https://pyo3.rs/) | [GitHub](https://github.com/PyO3/pyo3)
1313

14-
- PyO3 Asyncio API Documentation: [stable](https://docs.rs/pyo3-asyncio/) | [master](https://awestlake87.github.io/pyo3-asyncio/master/doc)
14+
- PyO3 Async Runtimes API Documentation: [stable](https://docs.rs/pyo3-async-runtimes/)
1515

1616
- Guide for Async / Await [stable](https://pyo3.rs/latest/ecosystem/async-await.html) | [main](https://pyo3.rs/main/ecosystem/async-await.html)
1717

18-
- Contributing Notes: [github](https://github.com/davidhewitt/pyo3-asyncio/blob/master/Contributing.md)
18+
- Contributing Notes: [github](https://github.com/PyO3/pyo3-async-runtimes/blob/main/Contributing.md)
1919

2020
> PyO3 Asyncio is a _brand new_ part of the broader PyO3 ecosystem. Feel free to open any issues for feature requests or bugfixes for this crate.
2121
@@ -31,7 +31,7 @@ Like PyO3, PyO3 Asyncio supports the following software versions:
3131
## PyO3 Asyncio Primer
3232

3333
If you are working with a Python library that makes use of async functions or wish to provide
34-
Python bindings for an async Rust library, [`pyo3-asyncio`](https://github.com/davidhewitt/pyo3-asyncio)
34+
Python bindings for an async Rust library, [`pyo3-async-runtimes`](https://github.com/PyO3/pyo3-async-runtimes)
3535
likely has the tools you need. It provides conversions between async functions in both Python and
3636
Rust and was designed with first-class support for popular Rust runtimes such as
3737
[`tokio`](https://tokio.rs/) and [`async-std`](https://async.rs/). In addition, all async Python
@@ -54,9 +54,9 @@ Here we initialize the runtime, import Python's `asyncio` library and run the gi
5454
```toml
5555
# Cargo.toml dependencies
5656
[dependencies]
57-
pyo3 = { version = "0.20" }
58-
pyo3-asyncio-0-21 = { version = "0.20", features = ["attributes", "async-std-runtime"] }
59-
async-std = "1.9"
57+
pyo3 = { version = "0.22" }
58+
pyo3-async-runtimes = { version = "0.22", features = ["attributes", "async-std-runtime"] }
59+
async-std = "1.13"
6060
```
6161

6262
```rust
@@ -84,9 +84,9 @@ attribute.
8484
```toml
8585
# Cargo.toml dependencies
8686
[dependencies]
87-
pyo3 = { version = "0.20" }
88-
pyo3-asyncio-0-21 = { version = "0.20", features = ["attributes", "tokio-runtime"] }
89-
tokio = "1.9"
87+
pyo3 = { version = "0.22" }
88+
pyo3-async-runtimes = { version = "0.22", features = ["attributes", "tokio-runtime"] }
89+
tokio = "1.40"
9090
```
9191

9292
```rust
@@ -108,7 +108,8 @@ async fn main() -> PyResult<()> {
108108
}
109109
```
110110

111-
More details on the usage of this library can be found in the [API docs](https://awestlake87.github.io/pyo3-asyncio/master/doc) and the primer below.
111+
More details on the usage of this library can be found in the API docs
112+
and the primer below.
112113

113114
#### PyO3 Native Rust Modules
114115

@@ -129,18 +130,18 @@ For `async-std`:
129130

130131
```toml
131132
[dependencies]
132-
pyo3 = { version = "0.20", features = ["extension-module"] }
133-
pyo3-asyncio-0-21 = { version = "0.20", features = ["async-std-runtime"] }
134-
async-std = "1.9"
133+
pyo3 = { version = "0.22", features = ["extension-module"] }
134+
pyo3-async-runtimes = { version = "0.22", features = ["async-std-runtime"] }
135+
async-std = "1.13"
135136
```
136137

137138
For `tokio`:
138139

139140
```toml
140141
[dependencies]
141142
pyo3 = { version = "0.20", features = ["extension-module"] }
142-
pyo3-asyncio-0-21 = { version = "0.20", features = ["tokio-runtime"] }
143-
tokio = "1.9"
143+
pyo3-async-runtimes = { version = "0.22", features = ["tokio-runtime"] }
144+
tokio = "1.40"
144145
```
145146

146147
Export an async function that makes use of `async-std`:
@@ -228,8 +229,8 @@ to do something special with the object that it returns.
228229

229230
Normally in Python, that something special is the `await` keyword, but in order to await this
230231
coroutine in Rust, we first need to convert it into Rust's version of a `coroutine`: a `Future`.
231-
That's where `pyo3-asyncio` comes in.
232-
[`pyo3_async_runtimes::into_future`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/fn.into_future.html)
232+
That's where `pyo3-async-runtimes` comes in.
233+
[`pyo3_async_runtimes::into_future`](https://docs.rs/pyo3-async-runtimes/latest/pyo3_async_runtimes/fn.into_future.html)
233234
performs this conversion for us:
234235

235236
```rust no_run
@@ -281,7 +282,7 @@ let future = rust_sleep();
281282

282283
We can convert this `Future` object into Python to make it `awaitable`. This tells Python that you
283284
can use the `await` keyword with it. In order to do this, we'll call
284-
[`pyo3_async_runtimes::async_std::future_into_py`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/async_std/fn.future_into_py.html):
285+
[`pyo3_async_runtimes::async_std::future_into_py`](https://docs.rs/pyo3-asyncio/latest/pyo3_async_runtimes/async_std/fn.future_into_py.html):
285286

286287
```rust
287288
use pyo3::prelude::*;
@@ -323,7 +324,7 @@ implementations _prefer_ control over the main thread, this can still make some
323324

324325
Because Python needs to control the main thread, we can't use the convenient proc macros from Rust
325326
runtimes to handle the `main` function or `#[test]` functions. Instead, the initialization for PyO3 has to be done from the `main` function and the main
326-
thread must block on [`pyo3_async_runtimes::run_forever`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/fn.run_forever.html) or [`pyo3_async_runtimes::async_std::run_until_complete`](https://docs.rs/pyo3-asyncio/latest/pyo3_asyncio/async_std/fn.run_until_complete.html).
327+
thread must block on [`pyo3_async_runtimes::run_forever`](https://docs.rs/pyo3-asyncio/latest/pyo3_async_runtimes/fn.run_forever.html) or [`pyo3_async_runtimes::async_std::run_until_complete`](https://docs.rs/pyo3-asyncio/latest/pyo3_async_runtimes/async_std/fn.run_until_complete.html).
327328

328329
Because we have to block on one of those functions, we can't use [`#[async_std::main]`](https://docs.rs/async-std/latest/async_std/attr.main.html) or [`#[tokio::main]`](https://docs.rs/tokio/1.1.0/tokio/attr.main.html)
329330
since it's not a good idea to make long blocking calls during an async function.
@@ -423,7 +424,7 @@ Python allows you to use alternatives to the default `asyncio` event loop. One
423424
popular alternative is `uvloop`. In `v0.13` using non-standard event loops was
424425
a bit of an ordeal, but in `v0.14` it's trivial.
425426

426-
#### Using `uvloop` in a PyO3 Asyncio Native Extensions
427+
#### Using `uvloop` in a PyO3 Native Extensions
427428

428429
```toml
429430
# Cargo.toml
@@ -433,10 +434,10 @@ name = "my_async_module"
433434
crate-type = ["cdylib"]
434435

435436
[dependencies]
436-
pyo3 = { version = "0.20", features = ["extension-module"] }
437-
pyo3-asyncio-0-21 = { version = "0.20", features = ["tokio-runtime"] }
438-
async-std = "1.9"
439-
tokio = "1.9"
437+
pyo3 = { version = "0.22", features = ["extension-module"] }
438+
pyo3-async-runtimes = { version = "0.22", features = ["tokio-runtime"] }
439+
async-std = "1.13"
440+
tokio = "1.40"
440441
```
441442

442443
```rust
@@ -492,9 +493,9 @@ event loop before we can install the `uvloop` policy.
492493

493494
```toml
494495
[dependencies]
495-
async-std = "1.9"
496-
pyo3 = "0.20"
497-
pyo3-asyncio-0-21 = { version = "0.20", features = ["async-std-runtime"] }
496+
async-std = "1.13"
497+
pyo3 = "0.22"
498+
pyo3-async-runtimes = { version = "0.22", features = ["async-std-runtime"] }
498499
```
499500

500501
```rust no_run
@@ -534,8 +535,8 @@ fn main() -> PyResult<()> {
534535

535536
### Additional Information
536537

537-
- Managing event loop references can be tricky with pyo3-asyncio. See [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/#event-loop-references-and-contextvars) in the API docs to get a better intuition for how event loop references are managed in this library.
538-
- Testing pyo3-asyncio libraries and applications requires a custom test harness since Python requires control over the main thread. You can find a testing guide in the [API docs for the `testing` module](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/testing)
538+
- Managing event loop references can be tricky with pyo3-async-runtimes. See [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_async_runtimes/#event-loop-references-and-contextvars) in the API docs to get a better intuition for how event loop references are managed in this library.
539+
- Testing pyo3-asyncio libraries and applications requires a custom test harness since Python requires control over the main thread. You can find a testing guide in the [API docs for the `testing` module](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_async_runtimes/testing)
539540

540541
## Migration Guide
541542

@@ -547,7 +548,7 @@ Well, a lot actually. There were some pretty major flaws in the initialization b
547548

548549
To make things a bit easier, I decided to keep most of the old API alongside the new one (with some deprecation warnings to encourage users to move away from it). It should be possible to use the `v0.13` API alongside the newer `v0.14` API, which should allow you to upgrade your application piecemeal rather than all at once.
549550

550-
**Before you get started, I personally recommend taking a look at [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/#event-loop-references-and-contextvars) in order to get a better grasp on the motivation behind these changes and the nuance involved in using the new conversions.**
551+
**Before you get started, I personally recommend taking a look at [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_async_runtimes/#event-loop-references-and-contextvars) in order to get a better grasp on the motivation behind these changes and the nuance involved in using the new conversions.**
551552

552553
### 0.14 Highlights
553554

@@ -635,7 +636,7 @@ To make things a bit easier, I decided to keep most of the old API alongside the
635636
```
636637

637638
4. Replace conversions with their newer counterparts.
638-
> You may encounter some issues regarding the usage of `get_running_loop` vs `get_event_loop`. For more details on these newer conversions and how they should be used see [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_asyncio/#event-loop-references-and-contextvars).
639+
> You may encounter some issues regarding the usage of `get_running_loop` vs `get_event_loop`. For more details on these newer conversions and how they should be used see [Event Loop References and ContextVars](https://awestlake87.github.io/pyo3-asyncio/master/doc/pyo3_async_runtimes/#event-loop-references-and-contextvars).
639640
- Replace `pyo3_async_runtimes::into_future` with `pyo3_async_runtimes::<runtime>::into_future`
640641
- Replace `pyo3_async_runtimes::<runtime>::into_coroutine` with `pyo3_async_runtimes::<runtime>::future_into_py`
641642
- Replace `pyo3_async_runtimes::get_event_loop` with `pyo3_async_runtimes::<runtime>::get_current_loop`

src/async_std.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//! are only available when the `unstable-streams` Cargo feature is enabled:
99
//!
1010
//! ```toml
11-
//! [dependencies.pyo3-asyncio-0-21]
12-
//! version = "0.21"
11+
//! [dependencies.pyo3-async-runtimes]
12+
//! version = "0.22"
1313
//! features = ["unstable-streams"]
1414
//! ```
1515

src/err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mod exceptions {
44
use pyo3::{create_exception, exceptions::PyException};
55

6-
create_exception!(pyo3_asyncio, RustPanic, PyException);
6+
create_exception!(pyo3_async_runtimes, RustPanic, PyException);
77
}
88

99
pub use exceptions::RustPanic;

src/generic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//! > are only available when the `unstable-streams` Cargo feature is enabled:
99
//!
1010
//! ```toml
11-
//! [dependencies.pyo3-asyncio-0-21]
12-
//! version = "0.21"
11+
//! [dependencies.pyo3-async-runtimes]
12+
//! version = "0.22"
1313
//! features = ["unstable-streams"]
1414
//! ```
1515
@@ -1651,8 +1651,8 @@ where
16511651
Ok(PyModule::from_code_bound(
16521652
py,
16531653
STREAM_GLUE,
1654-
"pyo3_asyncio/pyo3_asyncio_glue.py",
1655-
"pyo3_asyncio_glue",
1654+
"pyo3_async_runtimes/pyo3_async_runtimes_glue.py",
1655+
"pyo3_async_runtimes_glue",
16561656
)?
16571657
.into())
16581658
})?

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@
299299
//! > are only available when the `attributes` Cargo feature is enabled:
300300
//!
301301
//! ```toml
302-
//! [dependencies.pyo3-asyncio-0-21]
303-
//! version = "0.21"
302+
//! [dependencies.pyo3-async-runtimes]
303+
//! version = "0.22"
304304
//! features = ["attributes"]
305305
//! ```
306306
//!
@@ -312,8 +312,8 @@
312312
//! > are only available when the `async-std-runtime` Cargo feature is enabled:
313313
//!
314314
//! ```toml
315-
//! [dependencies.pyo3-asyncio-0-21]
316-
//! version = "0.21"
315+
//! [dependencies.pyo3-async-runtimes]
316+
//! version = "0.22"
317317
//! features = ["async-std-runtime"]
318318
//! ```
319319
//!
@@ -325,8 +325,8 @@
325325
//! > are only available when the `tokio-runtime` Cargo feature is enabled:
326326
//!
327327
//! ```toml
328-
//! [dependencies.pyo3-asyncio-0-21]
329-
//! version = "0.21"
328+
//! [dependencies.pyo3-async-runtimes]
329+
//! version = "0.22"
330330
//! features = ["tokio-runtime"]
331331
//! ```
332332
//!
@@ -338,8 +338,8 @@
338338
//! > are only available when the `testing` Cargo feature is enabled:
339339
//!
340340
//! ```toml
341-
//! [dependencies.pyo3-asyncio-0-21]
342-
//! version = "0.21"
341+
//! [dependencies.pyo3-async-runtimes]
342+
//! version = "0.22"
343343
//! features = ["testing"]
344344
//! ```
345345
@@ -363,7 +363,7 @@ pub mod err;
363363
pub mod generic;
364364

365365
#[pymodule]
366-
fn pyo3_asyncio(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
366+
fn pyo3_async_runtimes(py: Python, m: &Bound<PyModule>) -> PyResult<()> {
367367
m.add("RustPanic", py.get_type_bound::<err::RustPanic>())?;
368368
Ok(())
369369
}

0 commit comments

Comments
 (0)