<commit_before># Workflow to build and test wheels.
# To work on the wheel building infrastructure on a fork, comment out:
#
# if: github.repository == 'numpy/numpy'
#
# in the get_commit_message job. Be sure to include [wheel build] in your commit
# message to trigger the build. All files related to wheel building are located
# at tools/wheels/
# Alternatively, you can add labels to the pull request in order to trigger wheel
# builds.
# The labels that trigger builds are:
# 36 - Build(for changes to the building process,
# 03 - Maintenance(for dependency upgrades), and
# 14 - Release(ensure wheels build before release)
name: Wheel builder

on:
  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"
  push:
  pull_request:
      types: [labeled, opened, synchronize, reopened]
  workflow_dispatch:

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

jobs:
  get_commit_message:
    name: Get commit message
    runs-on: ubuntu-latest
    if: github.repository == 'numpy/numpy'
    outputs:
      message: ${{ steps.commit_message.outputs.message }}
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        # Gets the correct commit message for pull request
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Get commit message
        id: commit_message
        run: |
          set -xe
          COMMIT_MSG=$(git log --no-merges -1 --oneline)
          echo "::set-output name=message::$COMMIT_MSG"
          echo github.ref ${{ github.ref }}

  build_wheels:
    name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
    needs: get_commit_message
    if: >-
      contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      (contains(github.event.pull_request.labels.*.name, '36 - Build') ||
      contains(github.event.pull_request.labels.*.name, '03 - Maintenance') ||
      contains(github.event.pull_request.labels.*.name, '14 - Release'))) ||
      (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
    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]
        - [macos-10.15, macosx_*]
        - [windows-2019, win_amd64]
        - [windows-2019, win32]
        python: ["cp38", "cp39", "cp310"]
        include:
        # manylinux pypy builds
        - buildplat: [ubuntu-20.04, manylinux_x86_64]
          python: "pp38"

        # TODO: Uncomment and bump cibuildwheel version
        # once cibuildwheel adds PyPy 7.3.8
        # macOS pypy builds
        #- buildplat: [macos-10.15, macosx_x86_64]
        #  python: "pp38"

        # Windows PyPy builds
        - buildplat: [windows-2019, win_amd64]
          python: "pp38"
    env:
      IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
      IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
      IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        with:
          submodules: true
          # versioneer.py requires the latest tag to be reachable. Here we
          # fetch the complete history to get access to the tags.
          # A shallow clone can work when the following issue is resolved:
          # https://github.com/actions/checkout/issues/338
          fetch-depth: 0

      # Used to push the built wheels
      - uses: actions/setup-python@v2
        with:
          python-version: '3.x'

      - name: Configure mingw for 32-bit builds
        run: |
          # Force 32-bit mingw
          choco uninstall mingw
          choco install -y mingw --forcex86 --force --version=7.3.0
          echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
          refreshenv
        if: ${{ env.IS_32_BIT == 'true' }}

      - name: Build wheels
        uses: pypa/cibuildwheel@v2.3.1
        env:
          CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

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

      - name: Upload wheels
        if: success()
        shell: bash
        env:
          NUMPY_STAGING_UPLOAD_TOKEN: ${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
          NUMPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
        run: |
          source tools/wheels/upload_wheels.sh
          set_upload_vars
          # trigger an upload to
          # https://anaconda.org/scipy-wheels-nightly/numpy
          # for cron jobs or "Run workflow" (restricted to main branch).
          # Tags will upload to
          # https://anaconda.org/multibuild-wheels-staging/numpy
          # The tokens were originally generated at anaconda.org
          upload_wheels
  build_sdist:
    name: Build sdist
    needs: get_commit_message
    if: >-
      contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      (contains(github.event.pull_request.labels.*.name, '36 - Build') ||
      contains(github.event.pull_request.labels.*.name, '03 - Maintenance') ||
      contains(github.event.pull_request.labels.*.name, '14 - Release'))) ||
      (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
    runs-on: ubuntu-latest
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        with:
          submodules: true
          # versioneer.py requires the latest tag to be reachable. Here we
          # fetch the complete history to get access to the tags.
          # A shallow clone can work when the following issue is resolved:
          # https://github.com/actions/checkout/issues/338
          fetch-depth: 0
      # Used to push the built wheels
      - uses: actions/setup-python@v2
        with:
          # Build sdist on lowest supported Python
          python-version: '3.8'
      - name: Build sdist
        run: |
          python setup.py sdist
      - name: Test the sdist
        run: |
          # TODO: Don't run test suite, and instead build wheels from sdist<commit_msg>MAINT: remove maint from triggering wheel build, add env to sdist<commit_after># Workflow to build and test wheels.
# To work on the wheel building infrastructure on a fork, comment out:
#
# if: github.repository == 'numpy/numpy'
#
# in the get_commit_message job. Be sure to include [wheel build] in your commit
# message to trigger the build. All files related to wheel building are located
# at tools/wheels/
# Alternatively, you can add labels to the pull request in order to trigger wheel
# builds.
# The labels that trigger builds are:
# 36 - Build(for changes to the building process,
# 14 - Release(ensure wheels build before release)
name: Wheel builder

on:
  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"
  push:
  pull_request:
      types: [labeled, opened, synchronize, reopened]
  workflow_dispatch:

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

jobs:
  get_commit_message:
    name: Get commit message
    runs-on: ubuntu-latest
    if: github.repository == 'numpy/numpy'
    outputs:
      message: ${{ steps.commit_message.outputs.message }}
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        # Gets the correct commit message for pull request
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - name: Get commit message
        id: commit_message
        run: |
          set -xe
          COMMIT_MSG=$(git log --no-merges -1 --oneline)
          echo "::set-output name=message::$COMMIT_MSG"
          echo github.ref ${{ github.ref }}

  build_wheels:
    name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
    needs: get_commit_message
    if: >-
      contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      (contains(github.event.pull_request.labels.*.name, '36 - Build') ||
      contains(github.event.pull_request.labels.*.name, '14 - Release'))) ||
      (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
    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]
        - [macos-10.15, macosx_*]
        - [windows-2019, win_amd64]
        - [windows-2019, win32]
        python: ["cp38", "cp39", "cp310"]
        include:
        # manylinux pypy builds
        - buildplat: [ubuntu-20.04, manylinux_x86_64]
          python: "pp38"

        # TODO: Uncomment and bump cibuildwheel version
        # once cibuildwheel adds PyPy 7.3.8
        # macOS pypy builds
        #- buildplat: [macos-10.15, macosx_x86_64]
        #  python: "pp38"

        # Windows PyPy builds
        - buildplat: [windows-2019, win_amd64]
          python: "pp38"
    env:
      IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
      IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
      IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        with:
          submodules: true
          # versioneer.py requires the latest tag to be reachable. Here we
          # fetch the complete history to get access to the tags.
          # A shallow clone can work when the following issue is resolved:
          # https://github.com/actions/checkout/issues/338
          fetch-depth: 0

      # Used to push the built wheels
      - uses: actions/setup-python@v2
        with:
          python-version: '3.x'

      - name: Configure mingw for 32-bit builds
        run: |
          # Force 32-bit mingw
          choco uninstall mingw
          choco install -y mingw --forcex86 --force --version=7.3.0
          echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
          refreshenv
        if: ${{ env.IS_32_BIT == 'true' }}

      - name: Build wheels
        uses: pypa/cibuildwheel@v2.3.1
        env:
          CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

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

      - name: Upload wheels
        if: success()
        shell: bash
        env:
          NUMPY_STAGING_UPLOAD_TOKEN: ${{ secrets.NUMPY_STAGING_UPLOAD_TOKEN }}
          NUMPY_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}
        run: |
          source tools/wheels/upload_wheels.sh
          set_upload_vars
          # trigger an upload to
          # https://anaconda.org/scipy-wheels-nightly/numpy
          # for cron jobs or "Run workflow" (restricted to main branch).
          # Tags will upload to
          # https://anaconda.org/multibuild-wheels-staging/numpy
          # The tokens were originally generated at anaconda.org
          upload_wheels
  build_sdist:
    name: Build sdist
    needs: get_commit_message
    if: >-
      contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
      github.event_name == 'schedule' ||
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'pull_request' &&
      (contains(github.event.pull_request.labels.*.name, '36 - Build') ||
      contains(github.event.pull_request.labels.*.name, '14 - Release'))) ||
      (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
    runs-on: ubuntu-latest
    env:
      IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
      IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
    steps:
      - name: Checkout numpy
        uses: actions/checkout@v2
        with:
          submodules: true
          # versioneer.py requires the latest tag to be reachable. Here we
          # fetch the complete history to get access to the tags.
          # A shallow clone can work when the following issue is resolved:
          # https://github.com/actions/checkout/issues/338
          fetch-depth: 0
      # Used to push the built wheels
      - uses: actions/setup-python@v2
        with:
          # Build sdist on lowest supported Python
          python-version: '3.8'
      - name: Build sdist
        run: |
          python setup.py sdist
      - name: Test the sdist
        run: |
          # TODO: Don't run test suite, and instead build wheels from sdist
{'fraction_non_alphanumeric': 0.12812198150959017, 'fraction_numerical': 0.021112184352145714, 'mean_word_length': 2.351445086705202, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 10, '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': '4411975', 'n_tokens_mistral': 4856, 'n_tokens_neox': 4533, 'n_words': 1207}