Skip to content

Commit 5708a87

Browse files
committed
CI: add windows-latest job, matching the claimed Windows classifier
pyproject.toml classifies Operating System :: Microsoft :: Windows, but testing.yaml's matrix only ran ubuntu-latest, and the one test that behaves differently on Windows (test_autoread_dotenv_unreadable_file_warns, which relies on chmod-based permission denial) is skipif'd there - so that path was never actually exercised on the one platform it differs most on. Adds a single windows-latest job (Python 3.14) via matrix.include, rather than crossing all 7 Python versions with it, to keep the added job count small; it's free either way since this is a public repo (GitHub Actions minutes are unlimited for public repos on every runner OS). Two changes were needed to make the job actually work rather than just exist: - The ubuntu-remove-global-sitecustomize step is Linux-specific (sudo rm), so it's now gated behind `if: runner.os == 'Linux'`. - The job now forces `shell: bash` as the default, so the existing ${VAR}-style run steps use Windows' bundled Git Bash instead of falling back to pwsh's incompatible variable syntax. Verified: zizmor and the YAML parses cleanly; the justfile's install/build recipes already have [unix]/[windows] variants for the OS-sensitive steps (symlink creation, dir creation), so no changes were needed there.
1 parent 58a92bd commit 5708a87

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/testing.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
name: python
5656
runs-on: ${{ matrix.os }}
5757
timeout-minutes: 10
58+
defaults:
59+
run:
60+
# Force bash everywhere (incl. windows-latest, which ships Git Bash) so the
61+
# ${VAR}-style shell steps below behave identically across the matrix instead of
62+
# falling back to pwsh's incompatible syntax on Windows.
63+
shell: bash
5864
strategy:
5965
fail-fast: false
6066
matrix:
@@ -68,6 +74,13 @@ jobs:
6874
- "3.11"
6975
- "3.10"
7076
- "3.9"
77+
include:
78+
# Exercise the Windows-specific code paths at least once per run - e.g. the
79+
# permission-error handling in autoread_dotenv.utils, whose chmod-based test is
80+
# skipped under sys.platform == "win32" on other OSes - matching the
81+
# "Operating System :: Microsoft :: Windows" classifier in pyproject.toml.
82+
- os: windows-latest
83+
python-version: "3.14"
7184

7285
steps:
7386

@@ -114,11 +127,16 @@ jobs:
114127
PYTHON_VERSION: ${{ matrix.python-version }}
115128
run: uv python install "${PYTHON_VERSION}"
116129

130+
- name: Remove global sitecustomize.py
131+
# Ubuntu-only: unblocks our own sitecustomize entrypoint from the one preinstalled on
132+
# the runner image. Nothing equivalent exists to remove on windows-latest.
133+
if: runner.os == 'Linux'
134+
run: just ubuntu-remove-global-sitecustomize
135+
117136
- name: Install project + dependencies
118137
env:
119138
PYTHON_VERSION: ${{ matrix.python-version }}
120139
run: |
121-
just ubuntu-remove-global-sitecustomize
122140
just uv-set-python-version "${PYTHON_VERSION}"
123141
just install
124142

docs/changes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
- Add a `windows-latest` job (Python 3.14) to the `testing.yaml` CI matrix. The
8+
`Operating System :: Microsoft :: Windows` classifier was previously unbacked by any CI
9+
run: only `ubuntu-latest` was tested, and the one permission-related test that differs on
10+
Windows (`test_autoread_dotenv_unreadable_file_warns`) is `skipif`'d there, so that path
11+
was untested on the platform it'd differ from most. Gates the ubuntu-only
12+
`ubuntu-remove-global-sitecustomize` step behind `runner.os == 'Linux'` and forces `bash`
13+
as the default shell so the existing `${VAR}`-style steps work identically on Windows'
14+
Git Bash instead of falling back to incompatible pwsh syntax.
15+
716
- Remove stale `# pragma: no cover` markers on `get_metadata_package()`'s `ValueError`/
817
`PackageNotFoundError` fallbacks in `about.py`. Both branches are already exercised by
918
`tests/test_about.py` and hit 100% coverage on their own; the pragmas were just masking

0 commit comments

Comments
 (0)