<commit_before># Workflow to build wheels for upload to PyPI.
#
# In an attempt to save CI resources, wheel builds do
# not run on each push but only weekly and for releases.
# Wheel builds can be triggered from the Actions page
# (if you have the perms) on a commit to master.
# 
# Alternatively, if you would like to trigger wheel builds
# on a pull request, the labels that trigger builds are:
# - Build System

name: Wheel Builder
on:
  release:
    types: [created]
  schedule:
  #        ┌───────────── minute (0 - 59)
  #        │  ┌───────────── hour (0 - 23)
  #        │  │ ┌───────────── day of the month (1 - 31)
  #        │  │ │ ┌───────────── month (1 - 12 or JAN-DEC)
  #        │  │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
  #        │  │ │ │ │
  - cron: "42 1 * * 4"
  pull_request:
      types: [labeled, opened, synchronize, reopened]
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  build_wheels:
    name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
    if: >-
      github.event_name == 'release' ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      contains(github.event.pull_request.labels.*.name, 'Build System'))
    runs-on: ${{ matrix.buildplat[0] }}
    strategy:
      # Ensure that a wheel builder finishes even if another fails
      fail-fast: false
      matrix:
        # Github Actions doesn't support pairing matrix values together, let's improvise
        # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
        buildplat:
        - [ubuntu-20.04, manylinux_x86_64]
        - [ubuntu-20.04, manylinux_aarch64]
        - [ubuntu-20.04, manylinux_i686]
        - [ubuntu-20.04, musllinux_x86_64]
        - [ubuntu-20.04, musllinux_aarch64]
        - [macos-11, macosx_*]
        - [windows-2019, win_amd64]
        - [windows-2019, win32]
        python: ["cp36", "cp37", "cp38", "cp39", "cp310", "cp311"]  # Note: Wheels not needed for PyPy
    steps:
      - name: Checkout Cython
        uses: actions/checkout@v3
        
      - name: Set up QEMU
        if: contains(matrix.buildplat[1], '_aarch64')
        uses: docker/setup-qemu-action@v1
        with:
          platforms: all
      
      - name: Build wheels
        uses: pypa/cibuildwheel@v2.8.1
        env:
          # TODO: Build Cython with the compile-all flag?
          CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
          CIBW_PRERELEASE_PYTHONS: True
          CIBW_ARCHS_LINUX: auto aarch64
          CIBW_ENVIRONMENT: CFLAGS='-O3 -g0 -mtune=generic -pipe -fPIC' LDFLAGS='-fPIC'
          # TODO: Cython tests take a long time to complete
          # consider running a subset in the future?
          #CIBW_TEST_COMMAND: python {project}/runtests.py -vv --no-refnanny

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            dist/*manylinux*.whl
            dist/*musllinux*.whl
            dist/*macos*.whl
            dist/*win32*.whl
            dist/*win_amd64*.whl

      - uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
          path: ./wheelhouse/*.whl

  build_sdist_pure_wheel:
    name: Build sdist and pure wheel
    runs-on: ubuntu-latest
    steps:<commit_msg>CI: Disable the pure Python wheel builder unless we actually want wheels.<commit_after># Workflow to build wheels for upload to PyPI.
#
# In an attempt to save CI resources, wheel builds do
# not run on each push but only weekly and for releases.
# Wheel builds can be triggered from the Actions page
# (if you have the perms) on a commit to master.
# 
# Alternatively, if you would like to trigger wheel builds
# on a pull request, the labels that trigger builds are:
# - Build System

name: Wheel Builder
on:
  release:
    types: [created]
  schedule:
  #        ┌───────────── minute (0 - 59)
  #        │  ┌───────────── hour (0 - 23)
  #        │  │ ┌───────────── day of the month (1 - 31)
  #        │  │ │ ┌───────────── month (1 - 12 or JAN-DEC)
  #        │  │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
  #        │  │ │ │ │
  - cron: "42 1 * * 4"
  pull_request:
      types: [labeled, opened, synchronize, reopened]
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  build_wheels:
    name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
    if: >-
      github.event_name == 'release' ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      contains(github.event.pull_request.labels.*.name, 'Build System'))
    runs-on: ${{ matrix.buildplat[0] }}
    strategy:
      # Ensure that a wheel builder finishes even if another fails
      fail-fast: false
      matrix:
        # Github Actions doesn't support pairing matrix values together, let's improvise
        # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
        buildplat:
        - [ubuntu-20.04, manylinux_x86_64]
        - [ubuntu-20.04, manylinux_aarch64]
        - [ubuntu-20.04, manylinux_i686]
        - [ubuntu-20.04, musllinux_x86_64]
        - [ubuntu-20.04, musllinux_aarch64]
        - [macos-11, macosx_*]
        - [windows-2019, win_amd64]
        - [windows-2019, win32]
        python: ["cp36", "cp37", "cp38", "cp39", "cp310", "cp311"]  # Note: Wheels not needed for PyPy
    steps:
      - name: Checkout Cython
        uses: actions/checkout@v3
        
      - name: Set up QEMU
        if: contains(matrix.buildplat[1], '_aarch64')
        uses: docker/setup-qemu-action@v1
        with:
          platforms: all
      
      - name: Build wheels
        uses: pypa/cibuildwheel@v2.8.1
        env:
          # TODO: Build Cython with the compile-all flag?
          CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
          CIBW_PRERELEASE_PYTHONS: True
          CIBW_ARCHS_LINUX: auto aarch64
          CIBW_ENVIRONMENT: CFLAGS='-O3 -g0 -mtune=generic -pipe -fPIC' LDFLAGS='-fPIC'
          # TODO: Cython tests take a long time to complete
          # consider running a subset in the future?
          #CIBW_TEST_COMMAND: python {project}/runtests.py -vv --no-refnanny

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            dist/*manylinux*.whl
            dist/*musllinux*.whl
            dist/*macos*.whl
            dist/*win32*.whl
            dist/*win_amd64*.whl

      - uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
          path: ./wheelhouse/*.whl

  build_sdist_pure_wheel:
    name: Build sdist and pure wheel
    if: >-
      github.event_name == 'release' ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      contains(github.event.pull_request.labels.*.name, 'Build System'))
    runs-on: ubuntu-latest
    steps:
{'fraction_non_alphanumeric': 0.14054776219104875, 'fraction_numerical': 0.03072812291249165, 'mean_word_length': 2.3241563055062167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5973800', 'n_tokens_mistral': 2722, 'n_tokens_neox': 2476, 'n_words': 662}