Skip to content

Commit 2c30686

Browse files
author
Andrew J Westlake
committed
Updated async gen -> stream conversions to 0.15
2 parents 6f39da9 + ca168df commit 2c30686

28 files changed

+5099
-676
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
7+
pull_request:
8+
branches:
9+
- master
810

911
env:
1012
CARGO_TERM_COLOR: always
@@ -92,10 +94,10 @@ jobs:
9294
- name: Build (no features)
9395
run: cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
9496

95-
# Omit async-std-runtime feature for MSRV 1.45.0
97+
# Omit async-std-runtime and testing features from MSRV 1.45.0 (See README for details)
9698
- if: matrix.rust == '1.45.0'
9799
name: Prepare 1.45.0 features
98-
run: echo features=testing,attributes,tokio-runtime >> $GITHUB_ENV
100+
run: echo features=attributes,tokio-runtime >> $GITHUB_ENV
99101

100102
# Use all features for MSRV 1.46.0 and above
101103
- if: matrix.rust != '1.45.0'
@@ -105,21 +107,15 @@ jobs:
105107
- name: Build
106108
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
107109

110+
- if: matrix.platform.os != 'windows-latest'
111+
name: Install pyo3-asyncio test dependencies
112+
run: |
113+
python -m pip install -U uvloop
114+
108115
# Run tests (except on PyPy, because no embedding API).
109116
- if: matrix.python-version != 'pypy-3.6'
110117
name: Test
111118
run: cargo test --features=${{env.features}} --target ${{ matrix.platform.rust-target }}
112-
113-
- name: Install python test dependencies
114-
run: |
115-
python -m pip install -U pip setuptools
116-
pip install setuptools-rust pytest pytest-benchmark tox tox-venv
117-
# - name: Test example extension modules
118-
# shell: bash
119-
# run: |
120-
# for example_dir in examples/*; do
121-
# tox --discover $(which python) -c $example_dir -e py
122-
# done
123119
env:
124120
RUST_BACKTRACE: 1
125121
RUSTFLAGS: "-D warnings"
@@ -137,14 +133,17 @@ jobs:
137133
toolchain: nightly
138134
override: true
139135
profile: minimal
136+
- name: Install pyo3-asyncio test dependencies
137+
run: |
138+
python -m pip install -U uvloop
140139
- uses: actions-rs/cargo@v1
141140
with:
142141
command: test
143142
args: --all-features
144143
env:
145144
CARGO_INCREMENTAL: 0
146-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
147-
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
145+
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
146+
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
148147
- uses: actions-rs/[email protected]
149148
id: coverage
150149
- uses: codecov/codecov-action@v1

Cargo.toml

Lines changed: 27 additions & 6 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.13.3"
4+
version = "0.15.0"
55
authors = ["Andrew J Westlake <[email protected]>"]
66
readme = "README.md"
77
keywords = ["pyo3", "python", "ffi", "async", "asyncio"]
@@ -83,22 +83,43 @@ path = "pytests/test_tokio_multi_thread_run_forever.rs"
8383
harness = false
8484
required-features = ["tokio-runtime", "testing"]
8585

86+
[[test]]
87+
name = "test_async_std_uvloop"
88+
path = "pytests/test_async_std_uvloop.rs"
89+
harness = false
90+
required-features = ["async-std-runtime", "testing"]
91+
92+
[[test]]
93+
name = "test_tokio_current_thread_uvloop"
94+
path = "pytests/test_tokio_current_thread_uvloop.rs"
95+
harness = false
96+
required-features = ["tokio-runtime", "testing"]
97+
98+
[[test]]
99+
name = "test_tokio_multi_thread_uvloop"
100+
path = "pytests/test_tokio_multi_thread_uvloop.rs"
101+
harness = false
102+
required-features = ["tokio-runtime", "testing"]
103+
86104
[dependencies]
87105
async-channel = "1.6"
88106
clap = { version = "2.33", optional = true }
89107
futures = "0.3"
90108
inventory = "0.1"
91-
lazy_static = "1.4"
92109
once_cell = "1.5"
93-
pyo3 = "0.13"
94-
pyo3-asyncio-macros = { path = "pyo3-asyncio-macros", version = "=0.13.3", optional = true }
110+
pin-project-lite = "0.2"
111+
pyo3 = "0.15"
112+
pyo3-asyncio-macros = { path = "pyo3-asyncio-macros", version = "=0.15.0", optional = true }
113+
114+
[dev-dependencies]
115+
pyo3 = { version = "0.15", features = ["macros"] }
95116

96117
[dependencies.async-std]
97-
version = "1.9"
118+
version = "1.10"
98119
features = ["unstable"]
99120
optional = true
100121

101122
[dependencies.tokio]
102-
version = "1.4"
123+
version = "1.13"
103124
features = ["full"]
104125
optional = true

0 commit comments

Comments
 (0)