From 177668547b8e1d10e21ba0cc5df39c8e190d7d8b Mon Sep 17 00:00:00 2001 From: Ian Later Date: Tue, 19 May 2026 10:32:08 -0700 Subject: [PATCH 1/4] feat(python): Windows install checks --- .github/workflows/python_ci.yaml | 49 ++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python_ci.yaml b/.github/workflows/python_ci.yaml index 6f4f533db..3d7331bd8 100644 --- a/.github/workflows/python_ci.yaml +++ b/.github/workflows/python_ci.yaml @@ -106,17 +106,56 @@ jobs: --mypy-config-file ../pyproject.toml \ sift_client.resources.sync_stubs + # Smoke-test that the package installs on Windows. The full test/lint suite + # only runs on Linux (see test-python); this job exists to catch + # Windows-specific install regressions (e.g. a new dep without a Windows + # wheel) without doubling CI time. + install-python-windows: + needs: [changes] + if: | + always() && + (github.event_name != 'pull_request' || needs.changes.outputs.python == 'true') + runs-on: windows-latest + defaults: + run: + working-directory: python + # Use bash so the same '.[dev-all]' quoting works as on Linux; + # windows-latest ships Git Bash. + shell: bash + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - name: Pip install + run: | + python -m pip install --upgrade pip + pip install '.[dev-all]' + python-ci-status: if: always() - needs: [changes, test-python] + needs: [changes, test-python, install-python-windows] runs-on: ubuntu-latest steps: - name: Check result run: | - result="${{ needs.test-python.result }}" - if [[ "$result" == "success" || "$result" == "skipped" ]]; then - echo "python-ci passed (test-python: $result)" + test_result="${{ needs.test-python.result }}" + win_result="${{ needs.install-python-windows.result }}" + fail=0 + for r in "$test_result" "$win_result"; do + if [[ "$r" != "success" && "$r" != "skipped" ]]; then + fail=1 + fi + done + if [[ "$fail" -eq 0 ]]; then + echo "python-ci passed (test-python: $test_result, install-python-windows: $win_result)" else - echo "python-ci failed (test-python: $result)" + echo "python-ci failed (test-python: $test_result, install-python-windows: $win_result)" exit 1 fi From 38cb94f546f8396794db88845e991f3e5f6b182f Mon Sep 17 00:00:00 2001 From: Ian Later Date: Tue, 19 May 2026 10:35:26 -0700 Subject: [PATCH 2/4] windows lint --- .github/workflows/python_ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python_ci.yaml b/.github/workflows/python_ci.yaml index 3d7331bd8..1bc994e91 100644 --- a/.github/workflows/python_ci.yaml +++ b/.github/workflows/python_ci.yaml @@ -138,6 +138,10 @@ jobs: python -m pip install --upgrade pip pip install '.[dev-all]' + - name: Lint + run: | + ruff check + python-ci-status: if: always() needs: [changes, test-python, install-python-windows] From b400e7bf1de2e83b283ef9d4ff1b2e67cece185e Mon Sep 17 00:00:00 2001 From: Ian Later Date: Tue, 19 May 2026 11:31:09 -0700 Subject: [PATCH 3/4] mypy --- .github/workflows/python_ci.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python_ci.yaml b/.github/workflows/python_ci.yaml index 1bc994e91..c46a133ce 100644 --- a/.github/workflows/python_ci.yaml +++ b/.github/workflows/python_ci.yaml @@ -138,9 +138,11 @@ jobs: python -m pip install --upgrade pip pip install '.[dev-all]' - - name: Lint + # Re-run mypy with --platform=win32 so typeshed evaluates platform-gated + # stubs (e.g. fcntl) as if we were on Windows. + - name: MyPy (Windows platform) run: | - ruff check + mypy --platform=win32 lib python-ci-status: if: always() From 2cb605a3378f5093a0af518238575509c64b2aad Mon Sep 17 00:00:00 2001 From: Ian Later Date: Tue, 19 May 2026 13:17:07 -0700 Subject: [PATCH 4/4] ci(python): use mypy --platform=win32 in lieu of a Windows runner Drops the install-python-windows job and instead adds a `mypy --platform=win32 lib` step to the existing test-python job on ubuntu-latest. The Windows job only existed to surface platform-gated stub regressions like `import fcntl`; mypy with --platform=win32 picks up the same class of issues from typeshed without paying for a Windows runner. Co-authored-by: Cursor --- .github/workflows/python_ci.yaml | 62 +++++++------------------------- 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/.github/workflows/python_ci.yaml b/.github/workflows/python_ci.yaml index c46a133ce..1ec71fa55 100644 --- a/.github/workflows/python_ci.yaml +++ b/.github/workflows/python_ci.yaml @@ -72,6 +72,13 @@ jobs: run: | mypy lib + # Re-run mypy with --platform=win32 so typeshed evaluates platform-gated + # stubs (e.g. fcntl) as if we were on Windows. Catches imports that + # would only fail at runtime on Windows. + - name: MyPy (Windows platform) + run: | + mypy --platform=win32 lib + - name: Pyright run: | pyright lib @@ -106,62 +113,17 @@ jobs: --mypy-config-file ../pyproject.toml \ sift_client.resources.sync_stubs - # Smoke-test that the package installs on Windows. The full test/lint suite - # only runs on Linux (see test-python); this job exists to catch - # Windows-specific install regressions (e.g. a new dep without a Windows - # wheel) without doubling CI time. - install-python-windows: - needs: [changes] - if: | - always() && - (github.event_name != 'pull_request' || needs.changes.outputs.python == 'true') - runs-on: windows-latest - defaults: - run: - working-directory: python - # Use bash so the same '.[dev-all]' quoting works as on Linux; - # windows-latest ships Git Bash. - shell: bash - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - - name: Pip install - run: | - python -m pip install --upgrade pip - pip install '.[dev-all]' - - # Re-run mypy with --platform=win32 so typeshed evaluates platform-gated - # stubs (e.g. fcntl) as if we were on Windows. - - name: MyPy (Windows platform) - run: | - mypy --platform=win32 lib - python-ci-status: if: always() - needs: [changes, test-python, install-python-windows] + needs: [changes, test-python] runs-on: ubuntu-latest steps: - name: Check result run: | - test_result="${{ needs.test-python.result }}" - win_result="${{ needs.install-python-windows.result }}" - fail=0 - for r in "$test_result" "$win_result"; do - if [[ "$r" != "success" && "$r" != "skipped" ]]; then - fail=1 - fi - done - if [[ "$fail" -eq 0 ]]; then - echo "python-ci passed (test-python: $test_result, install-python-windows: $win_result)" + result="${{ needs.test-python.result }}" + if [[ "$result" == "success" || "$result" == "skipped" ]]; then + echo "python-ci passed (test-python: $result)" else - echo "python-ci failed (test-python: $test_result, install-python-windows: $win_result)" + echo "python-ci failed (test-python: $result)" exit 1 fi