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