From c646b035a87f83b01396df6039dc47a0b8fc4726 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 23 Nov 2023 22:33:26 -0500 Subject: [PATCH] Put back WSL on Windows CI; pare down debug info This undoes "Temporarily don't install WSL system to test xfail" (dabd2fb). It keeps Debian as the distribution. (Although the Debian WSL system installs pretty fast already, it may still make sense to try switching to Alpine in the future. But that might need to wait until https://github.com/Vampire/setup-wsl/issues/50 is fixed.) This also removes most of the commands in the WSL debugging step, since the related machinery in test_index.py (_WinBashStatus) seems to be in okay shape, condenses the smaller number of commands that are retained there, and makes much less extensive reduction in the general version and platform information commands as well. This is to make workflow output easier to read, understand, and navigate. --- .github/workflows/cygwin-test.yml | 4 +--- .github/workflows/pythonpackage.yml | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cygwin-test.yml b/.github/workflows/cygwin-test.yml index 96728e51a..13a01dec4 100644 --- a/.github/workflows/cygwin-test.yml +++ b/.github/workflows/cygwin-test.yml @@ -70,9 +70,7 @@ jobs: command -v git python git version python --version - python -c 'import sys; print(sys.platform)' - python -c 'import os; print(os.name)' - python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly. + python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' - name: Test with pytest run: | diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d21ea3949..3915296ef 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -35,6 +35,12 @@ jobs: python-version: ${{ matrix.python-version }} allow-prereleases: ${{ matrix.experimental }} + - name: Set up WSL (Windows) + if: startsWith(matrix.os, 'windows') + uses: Vampire/setup-wsl@v2.0.2 + with: + distribution: Debian + - name: Prepare this repo for tests run: | ./init-tests-after-clone.sh @@ -62,29 +68,15 @@ jobs: command -v git python git version python --version - python -c 'import sys; print(sys.platform)' - python -c 'import os; print(os.name)' - python -c 'import git; print(git.compat.is_win)' # NOTE: Deprecated. Use os.name directly. + python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' # For debugging hook tests on native Windows systems that may have WSL. - - name: Show where bash.exe may be found + - name: Show bash.exe candidates (Windows) if: startsWith(matrix.os, 'windows') run: | set +e - type -a bash.exe - python -c 'import shutil; print(shutil.which("bash.exe"))' - bash.exe --version - python -c 'import subprocess; p = subprocess.run(["bash.exe", "--version"]); print(f"result: {p!r}")' - bash.exe -c 'echo "$BASH"' - python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH" """]); print(f"result: {p!r}")' - bash.exe -c 'echo "$BASH_VERSION"' - python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", """echo "$BASH_VERSION" """]); print(f"result: {p!r}")' - bash.exe -c 'printenv WSL_DISTRO_NAME' - python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "printenv WSL_DISTRO_NAME"]); print(f"result: {p!r}")' - bash.exe -c 'ls -l /proc/sys/fs/binfmt_misc/WSLInterop' - python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "ls -l /proc/sys/fs/binfmt_misc/WSLInterop"]); print(f"result: {p!r}")' - bash.exe -c 'uname -a' - python -c 'import subprocess; p = subprocess.run(["bash.exe", "-c", "uname -a"]); print(f"result: {p!r}")' + bash.exe -c 'printenv WSL_DISTRO_NAME; uname -a' + python -c 'import subprocess; subprocess.run(["bash.exe", "-c", "printenv WSL_DISTRO_NAME; uname -a"])' continue-on-error: true - name: Check types with mypy