Skip to content

Commit 99335a7

Browse files
authored
Merge pull request #65 from awestlake87/pyo3-asyncio-0.16
Pyo3 asyncio 0.16
2 parents ca168df + 49bfc33 commit 99335a7

16 files changed

+1467
-1560
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: black --check .
2828
- name: Check rust formatting (rustfmt)
2929
run: cargo fmt --all -- --check
30-
30+
3131
clippy:
3232
runs-on: ubuntu-latest
3333
steps:
@@ -38,38 +38,80 @@ jobs:
3838
profile: minimal
3939
components: clippy
4040
- run: make clippy
41-
41+
4242
build:
4343
needs: [fmt] # don't wait for clippy as fails rarely and takes longer
4444
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
4545
runs-on: ${{ matrix.platform.os }}
4646
strategy:
47-
fail-fast: false # If one platform fails, allow the rest to keep testing.
47+
fail-fast: false # If one platform fails, allow the rest to keep testing.
4848
matrix:
4949
rust: [stable]
50-
python-version: [3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy-3.6]
51-
platform: [
52-
{ os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
53-
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
54-
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
55-
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
56-
]
50+
python-version:
51+
[
52+
"3.7",
53+
"3.8",
54+
"3.9",
55+
"3.10",
56+
"3.11-dev",
57+
"pypy-3.7",
58+
"pypy-3.8",
59+
"pypy-3.9",
60+
]
61+
platform:
62+
[
63+
{
64+
os: "macOS-latest",
65+
python-architecture: "x64",
66+
rust-target: "x86_64-apple-darwin",
67+
},
68+
{
69+
os: "ubuntu-latest",
70+
python-architecture: "x64",
71+
rust-target: "x86_64-unknown-linux-gnu",
72+
},
73+
{
74+
os: "windows-latest",
75+
python-architecture: "x64",
76+
rust-target: "x86_64-pc-windows-msvc",
77+
},
78+
{
79+
os: "windows-latest",
80+
python-architecture: "x86",
81+
rust-target: "i686-pc-windows-msvc",
82+
},
83+
]
5784
exclude:
58-
# There is no 64-bit pypy on windows
59-
- python-version: pypy-3.6
60-
platform: { os: "windows-latest", python-architecture: "x64" }
85+
# 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" }
90+
- python-version: pypy-3.9
91+
platform: { os: "windows-latest", python-architecture: "x86" }
6192
include:
62-
# Test minimal supported Rust version (no async-std)
63-
- rust: 1.45.0
64-
python-version: 3.9
65-
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
66-
msrv: "MSRV"
67-
# Test minimal supported Rust version (with async-std)
68-
- rust: 1.46.0
69-
python-version: 3.9
70-
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
93+
# Test minimal supported Rust version
94+
- rust: 1.48.0
95+
python-version: "3.10"
96+
platform:
97+
{
98+
os: "ubuntu-latest",
99+
python-architecture: "x64",
100+
rust-target: "x86_64-unknown-linux-gnu",
101+
}
71102
msrv: "MSRV"
72103

104+
# Test the `nightly` feature
105+
- rust: nightly
106+
python-version: "3.10"
107+
platform:
108+
{
109+
os: "ubuntu-latest",
110+
python-architecture: "x64",
111+
rust-target: "x86_64-unknown-linux-gnu",
112+
}
113+
extra_features: "nightly"
114+
73115
steps:
74116
- uses: actions/checkout@v2
75117

@@ -94,28 +136,15 @@ jobs:
94136
- name: Build (no features)
95137
run: cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
96138

97-
# Omit async-std-runtime and testing features from MSRV 1.45.0 (See README for details)
98-
- if: matrix.rust == '1.45.0'
99-
name: Prepare 1.45.0 features
100-
run: echo features=attributes,tokio-runtime >> $GITHUB_ENV
101-
102-
# Use all features for MSRV 1.46.0 and above
103-
- if: matrix.rust != '1.45.0'
104-
name: Prepare all features
105-
run: echo features=testing,attributes,tokio-runtime,async-std-runtime >> $GITHUB_ENV
106-
107139
- name: Build
108140
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
109141

110-
- if: matrix.platform.os != 'windows-latest'
142+
# uvloop doesn't compile under Windows, Python 3.11-dev, and PyPy
143+
- if: ${{ matrix.platform.os != 'windows-latest' && matrix.python-version != '3.11-dev' && !startsWith(matrix.python-version, 'pypy') }}
111144
name: Install pyo3-asyncio test dependencies
112145
run: |
113146
python -m pip install -U uvloop
114147
115-
# Run tests (except on PyPy, because no embedding API).
116-
- if: matrix.python-version != 'pypy-3.6'
117-
name: Test
118-
run: cargo test --features=${{env.features}} --target ${{ matrix.platform.rust-target }}
119148
env:
120149
RUST_BACKTRACE: 1
121150
RUSTFLAGS: "-D warnings"
@@ -138,7 +167,7 @@ jobs:
138167
python -m pip install -U uvloop
139168
- uses: actions-rs/cargo@v1
140169
with:
141-
command: test
170+
command: test
142171
args: --all-features
143172
env:
144173
CARGO_INCREMENTAL: 0
@@ -148,4 +177,4 @@ jobs:
148177
id: coverage
149178
- uses: codecov/codecov-action@v1
150179
with:
151-
file: ${{ steps.coverage.outputs.report }}
180+
file: ${{ steps.coverage.outputs.report }}

Cargo.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "pyo3-asyncio"
33
description = "PyO3 utilities for Python's Asyncio library"
4-
version = "0.15.0"
4+
version = "0.16.0"
55
authors = ["Andrew J Westlake <[email protected]>"]
66
readme = "README.md"
77
keywords = ["pyo3", "python", "ffi", "async", "asyncio"]
@@ -18,9 +18,10 @@ members = ["pyo3-asyncio-macros"]
1818

1919
[features]
2020
async-std-runtime = ["async-std"]
21-
attributes = ["pyo3-asyncio-macros"]
22-
testing = ["clap"]
21+
attributes = ["pyo3-asyncio-macros", "inventory"]
22+
testing = ["clap", "inventory"]
2323
tokio-runtime = ["tokio"]
24+
unstable-streams = ["async-channel"]
2425
default = []
2526

2627
[package.metadata.docs.rs]
@@ -102,16 +103,17 @@ harness = false
102103
required-features = ["tokio-runtime", "testing"]
103104

104105
[dependencies]
105-
clap = { version = "2.33", optional = true }
106+
async-channel = { version = "1.6", optional = true }
107+
clap = { version = "3.1.5", optional = true }
106108
futures = "0.3"
107-
inventory = "0.1"
109+
inventory = { version = "0.2", optional = true }
108110
once_cell = "1.5"
109111
pin-project-lite = "0.2"
110-
pyo3 = "0.15"
111-
pyo3-asyncio-macros = { path = "pyo3-asyncio-macros", version = "=0.15.0", optional = true }
112+
pyo3 = "0.16"
113+
pyo3-asyncio-macros = { path = "pyo3-asyncio-macros", version = "=0.16.0", optional = true }
112114

113115
[dev-dependencies]
114-
pyo3 = { version = "0.15", features = ["macros"] }
116+
pyo3 = { version = "0.16", features = ["macros"] }
115117

116118
[dependencies.async-std]
117119
version = "1.10"

0 commit comments

Comments
 (0)