From e8d5c5b1dd76d9726d53124987a2b70d77429ead Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Sep 2025 15:45:15 -0700 Subject: [PATCH 1/3] Revert "s/windows-2022/windows-latest/ in .github/workflows/{ci,pip}.yml (#5826)" This reverts commit 852a4b5010e339930e974e03eafdaaa3f6f32c36. --- .github/workflows/ci.yml | 20 ++++++++++---------- .github/workflows/pip.yml | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 010d5ddc94..9798f3aeee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: - runs-on: macos-latest python-version: 'graalpy-24.2' - - runs-on: windows-2022 + - runs-on: windows-latest python-version: '3.9' cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON - runs-on: windows-2022 @@ -138,19 +138,19 @@ jobs: - runs-on: windows-2022 python-version: '3.13' cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL - - runs-on: windows-2022 + - runs-on: windows-latest python-version: '3.13t' cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: windows-2022 + - runs-on: windows-latest python-version: '3.14' cmake-args: -DCMAKE_CXX_STANDARD=20 - - runs-on: windows-2022 + - runs-on: windows-latest python-version: '3.14t' cmake-args: -DCMAKE_CXX_STANDARD=23 - - runs-on: windows-2022 + - runs-on: windows-latest python-version: 'pypy-3.10' cmake-args: -DCMAKE_CXX_STANDARD=17 - - runs-on: windows-2022 + - runs-on: windows-latest python-version: 'pypy3.11' cmake-args: -DCMAKE_CXX_STANDARD=20 # The setup-python action currently doesn't have graalpy for windows @@ -174,7 +174,7 @@ jobs: python-version: '3.9' - runs-on: macos-latest python-version: '3.12' - - runs-on: windows-2022 + - runs-on: windows-latest python-version: '3.11' name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14" @@ -1010,8 +1010,8 @@ jobs: mingw: if: github.event.pull_request.draft == false - name: "🐍 3 • windows-2022 • ${{ matrix.sys }}" - runs-on: windows-2022 + name: "🐍 3 • windows-latest • ${{ matrix.sys }}" + runs-on: windows-latest defaults: run: shell: msys2 {0} @@ -1121,7 +1121,7 @@ jobs: strategy: matrix: - os: [windows-2022] + os: [windows-latest] python: ['3.10'] runs-on: "${{ matrix.os }}" diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 0347936dea..a5e7ffb519 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -19,8 +19,8 @@ jobs: # This builds the sdists and wheels and makes sure the files are exactly as # expected. test-packaging: - name: 🐍 3.8 • 📦 tests • windows-2022 - runs-on: windows-2022 + name: 🐍 3.8 • 📦 tests • windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v5 From 50d530ffc2c0d3b719f74b308c6a975a8844ae09 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Sep 2025 15:32:32 -0700 Subject: [PATCH 2/3] Add module-level skip for Windows build >= 26100 in test_iostream.py --- tests/test_iostream.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_iostream.py b/tests/test_iostream.py index c3d987787a..0352e109b8 100644 --- a/tests/test_iostream.py +++ b/tests/test_iostream.py @@ -8,6 +8,16 @@ from pybind11_tests import iostream as m +if sys.platform == "win32": + wv_build = sys.getwindowsversion().build + skip_if_ge = 26100 + if wv_build >= skip_if_ge: + pytest.skip( + f"Windows build {wv_build} >= {skip_if_ge}:" + " Skipping iostream capture (redirection regression under investigation)", + allow_module_level=True, + ) + def test_captured(capsys): msg = "I've been redirected to Python, I hope!" From 8b79a85b424ff721815e4937cee29017d046b4da Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Sep 2025 20:57:31 -0700 Subject: [PATCH 3/3] Changes suggested by at-henryiii --- tests/test_iostream.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_iostream.py b/tests/test_iostream.py index 0352e109b8..00b24ab706 100644 --- a/tests/test_iostream.py +++ b/tests/test_iostream.py @@ -6,15 +6,16 @@ import pytest +import env from pybind11_tests import iostream as m -if sys.platform == "win32": +if env.WIN: wv_build = sys.getwindowsversion().build skip_if_ge = 26100 if wv_build >= skip_if_ge: pytest.skip( f"Windows build {wv_build} >= {skip_if_ge}:" - " Skipping iostream capture (redirection regression under investigation)", + " Skipping iostream capture (redirection regression needs investigation)", allow_module_level=True, )