|
| 1 | +name: Build Windows wheels |
| 2 | + |
| 3 | +# Builds the Windows wheels kept in whl_files/ for the Python versions and |
| 4 | +# machines PyPI carries no wheel for, so a Windows install needs no compiler. |
| 5 | +# Each package is built from its PyPI sdist, checked against the pinned |
| 6 | +# sha256, then installed into a clean venv and exercised before upload. |
| 7 | +# Download the artifacts and commit the wheels by hand, with a requirements.txt |
| 8 | +# line for each. |
| 9 | +# |
| 10 | +# Gaps covered, measured against PyPI on 2026-10-19: |
| 11 | +# x64 3.15: no cp315 wheels for pyliblzfse, astc-decomp-faster, pyahocorasick. |
| 12 | +# ARM64 3.11 to 3.15: none of those three publishes win_arm64 wheels. |
| 13 | +# numpy 1.26.4 has no win_arm64 wheel either, and MSVC 19.51 stops on it with |
| 14 | +# internal compiler errors, so requirements.txt gives Windows ARM64 numpy 2. |
| 15 | +# setup-python offers Windows ARM64 builds of Python from 3.11 only. |
| 16 | + |
| 17 | +on: |
| 18 | + # A change to this file rebuilds and checks every wheel. |
| 19 | + pull_request: |
| 20 | + paths: |
| 21 | + - '.github/workflows/build_windows_wheels.yml' |
| 22 | + workflow_dispatch: |
| 23 | + |
| 24 | +permissions: |
| 25 | + contents: read |
| 26 | + |
| 27 | +jobs: |
| 28 | + build: |
| 29 | + name: build ${{ matrix.package.name }} ${{ matrix.target.arch }} ${{ matrix.target.python }} |
| 30 | + runs-on: ${{ matrix.target.runner }} |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + target: |
| 35 | + - { runner: windows-latest, arch: x64, python: '3.15' } |
| 36 | + - { runner: windows-11-arm, arch: arm64, python: '3.11' } |
| 37 | + - { runner: windows-11-arm, arch: arm64, python: '3.12' } |
| 38 | + - { runner: windows-11-arm, arch: arm64, python: '3.13' } |
| 39 | + - { runner: windows-11-arm, arch: arm64, python: '3.14' } |
| 40 | + - { runner: windows-11-arm, arch: arm64, python: '3.15' } |
| 41 | + package: |
| 42 | + - name: pyliblzfse |
| 43 | + version: 0.4.1 |
| 44 | + sdist: https://files.pythonhosted.org/packages/2c/ba/a4bc465d36f6aafbff89da1bf67bcc6a97475b1d2300a74a778dcb293cef/pyliblzfse-0.4.1.tar.gz |
| 45 | + sha256: bb0b899b3830c02fdf3dbde48ea59611833f366fef836e5c32cf8145134b7d3d |
| 46 | + check: | |
| 47 | + import liblzfse |
| 48 | + data = bytes(range(256)) * 64 |
| 49 | + assert liblzfse.decompress(liblzfse.compress(data)) == data |
| 50 | + - name: astc-decomp-faster |
| 51 | + version: 1.1.5 |
| 52 | + sdist: https://files.pythonhosted.org/packages/46/0c/9175a74d7dfb5743b027b97dc15127802d882cb1154b779fe857801ca325/astc_decomp_faster-1.1.5.tar.gz |
| 53 | + sha256: c84865c97231996a9a4f12c9f4d676633808afe62f4df230dfd740ee7d3054b4 |
| 54 | + needs: pillow |
| 55 | + check: | |
| 56 | + import astc_decomp_faster # registers Pillow's "astc" decoder |
| 57 | + from PIL import Image |
| 58 | + # A void-extent block: one constant colour for the whole 4x4 block. |
| 59 | + block = bytes([0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 60 | + 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF]) |
| 61 | + image = Image.frombytes('RGBA', (4, 4), block, 'astc', (4, 4, False)) |
| 62 | + assert image.getpixel((0, 0)) == (255, 0, 0, 255), image.getpixel((0, 0)) |
| 63 | + - name: pyahocorasick |
| 64 | + version: 2.3.1 |
| 65 | + sdist: https://files.pythonhosted.org/packages/b0/3c/dc9e31a0f004eabe2ef5d31456766555a02e2af29e159daa31266934af79/pyahocorasick-2.3.1.tar.gz |
| 66 | + sha256: 9d0f6bb522237ed7f111ed59c9e8baea7d1e75813587b6773babd43bda35db9f |
| 67 | + check: | |
| 68 | + import ahocorasick |
| 69 | + automaton = ahocorasick.Automaton() |
| 70 | + for word in ('he', 'she', 'hers'): |
| 71 | + automaton.add_word(word, word) |
| 72 | + automaton.make_automaton() |
| 73 | + assert sorted(found for _, found in automaton.iter('ushers')) == ['he', 'hers', 'she'] |
| 74 | +
|
| 75 | + steps: |
| 76 | + - uses: actions/setup-python@v7 |
| 77 | + with: |
| 78 | + python-version: ${{ matrix.target.python }} |
| 79 | + architecture: ${{ matrix.target.arch }} |
| 80 | + |
| 81 | + - name: Download and verify the sdist |
| 82 | + shell: bash |
| 83 | + run: | |
| 84 | + curl -sSfL -o sdist.tar.gz "${{ matrix.package.sdist }}" |
| 85 | + echo "${{ matrix.package.sha256 }} sdist.tar.gz" | sha256sum -c - |
| 86 | +
|
| 87 | + - name: Build the wheel |
| 88 | + shell: bash |
| 89 | + run: python -m pip wheel --no-deps --wheel-dir dist sdist.tar.gz |
| 90 | + |
| 91 | + - name: Install into a clean venv and exercise it |
| 92 | + shell: bash |
| 93 | + env: |
| 94 | + CHECK: ${{ matrix.package.check }} |
| 95 | + run: | |
| 96 | + python -m venv check |
| 97 | + check/Scripts/python -m pip install --quiet --no-index dist/*.whl |
| 98 | + if [ -n "${{ matrix.package.needs }}" ]; then |
| 99 | + check/Scripts/python -m pip install --quiet --only-binary=:all: ${{ matrix.package.needs }} |
| 100 | + fi |
| 101 | + printf '%s\n' "$CHECK" > check.py |
| 102 | + check/Scripts/python check.py |
| 103 | + check/Scripts/python -c "import platform, sys; print(sys.version, platform.machine())" |
| 104 | + sha256sum dist/*.whl |
| 105 | + python -m zipfile -l dist/*.whl |
| 106 | +
|
| 107 | + - uses: actions/upload-artifact@v7 |
| 108 | + with: |
| 109 | + name: ${{ matrix.package.name }}-${{ matrix.package.version }}-py${{ matrix.target.python }}-${{ matrix.target.arch }} |
| 110 | + path: dist/*.whl |
| 111 | + if-no-files-found: error |
0 commit comments