Ignore W009/W010 in wheel-contents check for repaired wheels #525
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: [push, pull_request] | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, windows-2022, macOS-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 # needed for history/tags | |
| # Enable emulation for aarch64 | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| # Used to host cibuildwheel | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Get python_ics version | |
| uses: mtkennerly/dunamai-action@v1 | |
| with: | |
| env-var: PYTHON_ICS_VERSION | |
| args: --format "v{base}-{commit}-{timestamp}" | |
| - name: Print python_ics version | |
| run: echo $PYTHON_ICS_VERSION | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python_ics-${{ matrix.os }}-${{ env.PYTHON_ICS_VERSION }} | |
| path: ./wheelhouse/*.whl | |
| if-no-files-found: error | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: python_ics-* | |
| merge-multiple: true | |
| path: ./wheelhouse/ | |
| deploy_pypi: | |
| name: "Deploy PyPI" | |
| runs-on: ubuntu-latest | |
| needs: build_wheels | |
| if: | | |
| github.ref_name == 'master' || | |
| startsWith(github.event.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: uv.lock | |
| - name: Set up Python | |
| run: | | |
| uv python install 3.12 | |
| uv venv -p 3.12 | |
| source .venv/bin/activate | |
| uv pip install check-wheel-contents twine | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: python_ics-* | |
| merge-multiple: true | |
| path: ./wheelhouse/ | |
| - name: "Publish to PyPI" | |
| if: | | |
| github.ref_name == 'master' || | |
| startsWith(github.event.ref, 'refs/tags/v') | |
| run: | | |
| source .venv/bin/activate | |
| uv pip install check-wheel-contents twine | |
| # W009/W010 fire on the delvewheel-repaired Windows wheels, whose | |
| # vendored-runtime dir (python_ics.libs/ with msvcp140*.dll) is a | |
| # second toplevel entry with no Python modules. That layout is | |
| # correct for repaired wheels; a [tool.check-wheel-contents] | |
| # toplevel allowlist would instead fail the macOS/Linux wheels, | |
| # which don't have the directory. | |
| check-wheel-contents --ignore W009,W010 ./wheelhouse/*.whl | |
| twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --verbose ./wheelhouse/* |