Skip to content

Commit bced7db

Browse files
authored
ci: make mingw builds robust to version bumps (PyO3#501)
* ci: make mingw builds robust to version bumps * try nox fork * use nox from upstream git
1 parent 2c6a567 commit bced7db

File tree

2 files changed

+6
-44
lines changed

2 files changed

+6
-44
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,16 +400,18 @@ jobs:
400400

401401
- name: Install test dependencies
402402
shell: msys2 {0}
403-
run: python -m pip install --upgrade nox pip
403+
# TODO: use stable nox after the targeted commit is released
404+
run: python -m pip install --upgrade pip 'nox @ git+https://github.com/wntrblm/nox.git@60acbbe5574e4458931d96ac4733b91d0db1b50d'
404405

405406
- name: Create libpython symlink
406407
shell: msys2 {0}
407-
run: ln -s /${{ matrix.path }}/lib/libpython3.11.dll.a /${{ matrix.path }}/lib/libpython311.dll.a
408+
run: |
409+
PYTHON_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)")
410+
ln -s /${{ matrix.path }}/lib/libpython3.${PYTHON_MINOR_VER}.dll.a /${{ matrix.path }}/lib/libpython3${PYTHON_MINOR_VER}.dll.a
408411
409412
- name: Test examples
410413
shell: msys2 {0}
411-
run: |
412-
PATH="$PATH:/c/Users/runneradmin/.cargo/bin" nox -s test-mingw
414+
run: PATH="$PATH:/c/Users/runneradmin/.cargo/bin" nox -s test-examples
413415

414416
test-emscripten:
415417
name: Test Emscripten

noxfile.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from inspect import cleandoc as heredoc
33
from glob import glob
44
from pathlib import Path
5-
from unittest.mock import patch
65

76
import nox
87
import nox.command
@@ -156,45 +155,6 @@ def test(session: nox.Session):
156155
session.run("pytest", "setuptools_rust", "tests", *session.posargs)
157156

158157

159-
@nox.session(name="test-mingw")
160-
def test_mingw(session: nox.Session):
161-
# manually re-implemented test-examples to workaround
162-
# https://github.com/wntrblm/nox/issues/630
163-
164-
oldrun = nox.command.run
165-
166-
def newrun(*args, **kwargs):
167-
# suppress "external" error on install
168-
kwargs["external"] = True
169-
oldrun(*args, **kwargs)
170-
171-
examples = Path(os.path.dirname(__file__)).absolute() / "examples"
172-
173-
with patch.object(nox.command, "run", newrun):
174-
session.install(".")
175-
176-
session.install("--no-build-isolation", str(examples / "hello-world"))
177-
session.run("print-hello")
178-
session.run("sum-cli", "5", "7")
179-
session.run("rust-demo", "5", "7")
180-
181-
session.install("pytest", "pytest-benchmark", "beautifulsoup4")
182-
session.install("--no-build-isolation", str(examples / "html-py-ever"))
183-
session.run("pytest", str(examples / "html-py-ever"))
184-
185-
session.install("--no-build-isolation", str(examples / "namespace_package"))
186-
session.run("pytest", str(examples / "namespace_package"))
187-
188-
try:
189-
session.install("cffi", "--only-binary=cffi")
190-
except nox.command.CommandFailed:
191-
# no compatible cffi currently available on mingw
192-
pass
193-
else:
194-
session.install("--no-build-isolation", str(examples / "rust_with_cffi"))
195-
session.run("pytest", str(examples / "rust_with_cffi"))
196-
197-
198158
@nox.session(name="test-examples-emscripten")
199159
def test_examples_emscripten(session: nox.Session):
200160
session.install(".", "build")

0 commit comments

Comments
 (0)