Skip to content

Commit b15b39c

Browse files
committed
ci: fix msrv job
1 parent d5bdc3f commit b15b39c

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,45 @@ jobs:
126126
# name: Prepare LD_LIBRARY_PATH (Ubuntu only)
127127
# run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GIHUB_ENV
128128

129+
- name: Unify MSRV dependencies
130+
run: |
131+
import toml
132+
cargo_toml = toml.load("Cargo.toml")
133+
cargo_toml["dependencies"]["tokio"]["version"] = "1.38.1"
134+
with open("Cargo.toml", "w") as f:
135+
toml.dump(cargo_toml, f)
136+
working-directory: examples/simple
137+
shell: python
138+
- name: Generate lockfile
139+
run: cargo generate-lockfile
140+
working-directory: examples/simple
141+
- name: Unify dependencies to MSRV-compatible versions
142+
run: |
143+
import toml
144+
import subprocess
145+
cargo_lock = toml.load("Cargo.lock")
146+
for pkg in cargo_lock["package"]:
147+
pkg_id = pkg["name"] + ":" + pkg["version"]
148+
if pkg["name"] == "tokio" and pkg["version"] != "1.38.1":
149+
subprocess.run(["cargo", "update", "--package", pkg_id, "--precise", "1.38.1"], check=True)
150+
129151
- name: Build (no features)
130152
run: cargo build --no-default-features --verbose --target ${{ matrix.platform.rust-target }}
131153

132154
- name: Build
133155
run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }}
134156

135-
# uvloop doesn't compile under Windows, Python 3.11-dev, and PyPy
136-
- if: ${{ matrix.platform.os != 'windows-latest' && matrix.python-version != '3.11-dev' && !startsWith(matrix.python-version, 'pypy') }}
157+
# uvloop doesn't compile under Windows and PyPy
158+
- if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') }}
137159
name: Install pyo3-asyncio test dependencies
138160
run: |
139161
python -m pip install -U uvloop
140162
141-
- if: ${{ matrix.msrv != 'MSRV' && matrix.python-version != '3.11-dev' && !startsWith(matrix.python-version, 'pypy') }}
163+
- if: ${{ matrix.msrv != 'MSRV' && !startsWith(matrix.python-version, 'pypy') }}
142164
name: Test
143165
run: cargo test --all-features --target ${{ matrix.platform.rust-target }}
144166

145-
- if: ${{ matrix.msrv == 'MSRV' && matrix.python-version != '3.11-dev' && !startsWith(matrix.python-version, 'pypy') }}
167+
- if: ${{ matrix.msrv == 'MSRV' && !startsWith(matrix.python-version, 'pypy') }}
146168
name: Test (MSRV, --no-default-features)
147169
run: cargo test --no-default-features --features tokio-runtime,async-std-runtime,attributes,unstable-streams --target ${{ matrix.platform.rust-target }}
148170

0 commit comments

Comments
 (0)