<commit_before>name: Python CI/CD

on:
  push:
  pull_request:
  release:
    types:
      - published

jobs:

  build_sdist:
    name: Build source distribution
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - 3.8

    steps:

      - uses: actions/checkout@master
      - run: git fetch --prune --unshallow

      - name: Install Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install sdist dependencies
        run: pip install setuptools_scm cmake_build_extension

      - name: Build sdist
        run: python setup.py sdist

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            build-essential \
            coinor-libipopt-dev \
            libeigen3-dev swig \
            libxml2-dev \
            libassimp-dev

      - name: Install sdist
        run: pip -v install dist/*.tar.gz

      - name: Test import
        run: python -c 'import idyntree.bindings'

      - uses: actions/upload-artifact@v2
        if: github.repository == 'robotology/idyntree'
        with:
          path: dist/*.tar.gz

  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - 3.8
        os:
          - ubuntu-latest
          # - macos-latest
          # - windows-latest

    steps:

      - uses: actions/checkout@master
      - run: git fetch --prune --unshallow

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install cibuildwheel
        run: pip install cibuildwheel

      - name: Build wheels
        run: python -m cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD_VERBOSITY: 1
          CIBW_BUILD: cp38-manylinux_x86_64
          CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
          CIBW_BEFORE_BUILD: "yum install -y eigen3-devel assimp-devel libxml2-devel coin-or-Ipopt-devel swig3"
          CIBW_TEST_COMMAND: "python -c 'import idyntree.bindings'"

      - uses: actions/upload-artifact@v2
        if: github.repository == 'robotology/idyntree'
        with:
          path: ./wheelhouse/*.whl
<commit_msg>Upload only linux_x86_64 wheels instead of manylinux2014<commit_after>name: Python CI/CD

on:
  push:
  pull_request:
  release:
    types:
      - published

jobs:

  build_sdist:
    name: Build source distribution
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - 3.8

    steps:

      - uses: actions/checkout@master
      - run: git fetch --prune --unshallow

      - name: Install Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install sdist dependencies
        run: pip install setuptools_scm cmake_build_extension

      - name: Build sdist
        run: python setup.py sdist

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            build-essential \
            coinor-libipopt-dev \
            libeigen3-dev swig \
            libxml2-dev \
            libassimp-dev

      - name: Install sdist
        run: pip -v install dist/*.tar.gz

      - name: Test import
        run: python -c 'import idyntree.bindings'

      - uses: actions/upload-artifact@v2
        if: github.repository == 'robotology/idyntree'
        with:
          path: dist/*.tar.gz

  build_wheels:
    name: Build wheels on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - 3.8
        os:
          - ubuntu-latest
          # - macos-latest
          # - windows-latest

    steps:

      - uses: actions/checkout@master
      - run: git fetch --prune --unshallow

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install cibuildwheel
        run: pip install cibuildwheel

      - name: Build wheels
        run: python -m cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD_VERBOSITY: 1
          CIBW_BUILD: cp38-manylinux_x86_64
          CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
          CIBW_BEFORE_BUILD: "yum install -y eigen3-devel assimp-devel libxml2-devel coin-or-Ipopt-devel swig3"
          CIBW_TEST_COMMAND: "python -c 'import idyntree.bindings'"
          # Note: here we repair the wheel maintaining the linux_x86_64 platform
          CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --plat linux_x86_64 -w {dest_dir} {wheel}"

      # Rename the wheel to manylinux2014 (even if it is not) so that it can be uploaded to PyPI
      - name: Rename wheels
        if: matrix.os == 'ubuntu-latest'
        run: |
          ls wheelhouse/
          find wheelhouse/ -type f -name "*.whl" -exec rename.ul linux manylinux2014 {} +
          ls wheelhouse/

      - uses: actions/upload-artifact@v2
        if: github.repository == 'robotology/idyntree'
        with:
          path: ./wheelhouse/*.whl

{'fraction_non_alphanumeric': 0.08985562310030396, 'fraction_numerical': 0.015197568389057751, 'mean_word_length': 1.7710526315789474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '94051', 'n_tokens_mistral': 1731, 'n_tokens_neox': 1614, 'n_words': 411}