Flatten assign op calls #1491
This file contains 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
# Workflow to build | |
name: Wheels | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
# Build the wheels for Linux, Windows and macOS for CPython 3.7 and newer | |
build_wheels: | |
name: Build wheel for ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Ensure that a wheel builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
include: | |
# Window 64 bit | |
- os: windows-latest | |
pythonVersion: 37 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
- os: windows-latest | |
pythonVersion: 38 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
- os: windows-latest | |
pythonVersion: 39 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
- os: windows-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
- os: windows-latest | |
pythonVersion: 311 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
- os: windows-latest | |
pythonVersion: 312 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "cp" | |
# Arm Windows | |
# - os: windows-latest | |
# pythonVersion: 39 | |
# bitness: 32 | |
# platformID: win_arm64 | |
# pythonType: "cp" | |
# - os: windows-latest | |
# pythonVersion: 310 | |
# bitness: 32 | |
# platformID: win_arm64 | |
# pythonType: "cp" | |
# - os: windows-latest | |
# pythonVersion: 311 | |
# bitness: 32 | |
# platformID: win_arm64 | |
# pythonType: "cp" | |
# - os: windows-latest | |
# pythonVersion: 312 | |
# bitness: 32 | |
# platformID: win_arm64 | |
# pythonType: "cp" | |
# PyPy on Windows | |
# - os: windows-latest | |
# pythonVersion: 37 | |
# bitness: 64 | |
# platformID: win_amd64 | |
# pythonType: "pp" | |
# - os: windows-latest | |
# pythonVersion: 38 | |
# bitness: 64 | |
# platformID: win_amd64 | |
# pythonType: "pp" | |
# - os: windows-latest | |
# pythonVersion: 39 | |
# bitness: 64 | |
# platformID: win_amd64 | |
# pythonType: "pp" | |
- os: windows-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: win_amd64 | |
pythonType: "pp" | |
# Linux 64 bit manylinux2014 | |
- os: ubuntu-latest | |
pythonVersion: 37 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
- os: ubuntu-latest | |
pythonVersion: 38 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
- os: ubuntu-latest | |
pythonVersion: 39 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
- os: ubuntu-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
- os: ubuntu-latest | |
pythonVersion: 311 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
- os: ubuntu-latest | |
pythonVersion: 312 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "cp" | |
# Linux PyPy 64 bit manylinux2014 | |
- os: ubuntu-latest | |
pythonVersion: 37 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "pp" | |
- os: ubuntu-latest | |
pythonVersion: 38 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "pp" | |
- os: ubuntu-latest | |
pythonVersion: 39 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "pp" | |
- os: ubuntu-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: manylinux_x86_64 | |
manylinux_image: manylinux2014 | |
pythonType: "pp" | |
# MacOS x86_64 | |
- os: macos-latest | |
pythonVersion: 37 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 38 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 39 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 311 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 312 | |
bitness: 64 | |
platformID: macosx_x86_64 | |
pythonType: "cp" | |
# Apple-Silicon MacOS | |
- os: macos-latest | |
pythonVersion: 38 | |
bitness: 64 | |
platformID: macosx_arm64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 39 | |
bitness: 64 | |
platformID: macosx_arm64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 310 | |
bitness: 64 | |
platformID: macosx_arm64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 311 | |
bitness: 64 | |
platformID: macosx_arm64 | |
pythonType: "cp" | |
- os: macos-latest | |
pythonVersion: 312 | |
bitness: 64 | |
platformID: macosx_arm64 | |
pythonType: "cp" | |
# Apple-Silicon MacOS PyPy | |
# - os: macos-latest | |
# pythonVersion: 38 | |
# bitness: 64 | |
# platformID: macosx_arm64 | |
# pythonType: "pp" | |
# - os: macos-latest | |
# pythonVersion: 39 | |
# bitness: 64 | |
# platformID: macosx_arm64 | |
# pythonType: "pp" | |
# - os: macos-latest | |
# pythonVersion: 310 | |
# bitness: 64 | |
# platformID: macosx_arm64 | |
# pythonType: "pp" | |
steps: | |
- name: Workflow Telemetry | |
uses: runforesight/[email protected] | |
with: | |
theme: "dark" | |
- name: Checkout LibRapid | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install Requirements | |
run: pip install -r requirements.txt | |
- name: Install XCode | |
if: runner.os == 'macOS' | |
uses: maxim-lobanov/[email protected] | |
with: | |
xcode-version: latest | |
- name: Install Clang | |
if: runner.os == 'macOS' | |
run: | | |
rm -f '/usr/local/bin/2to3*' | |
brew install llvm libomp | |
- name: Install Clang | |
if: runner.os == 'Windows' | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: '15.0' | |
directory: ${RUNNER_TOOL_CACHE} | |
env: on | |
- name: Set C/CXX Compiler for Windows | |
if: runner.os == 'Windows' | |
run: | | |
cd scripts | |
python setPythonLibCompiler.py -cc ${RUNNER_TOOL_CACHE}/llvm/bin/clang -cxx ${RUNNER_TOOL_CACHE}/llvm/bin/clang++ -o pyproject.toml | |
- name: Build Wheels | |
if: runner.os == 'macOS' | |
run: | | |
python -m pip install cibuildwheel | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }} | |
CIBW_ARCHS: all | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_BUILD_VERBOSITY: 1 | |
MACOSX_DEPLOYMENT_TARGET: 10.15 | |
CMAKE_BUILD_PARALLEL_LEVEL: 1 | |
GITHUB_ACTIONS: ON | |
LIBRAPID_GET_BLAS: OFF | |
LIBRAPID_GET_FFTW: OFF | |
CC: /usr/local/opt/llvm/bin/clang | |
CXX: /usr/local/opt/llvm/bin/clang++ | |
CIBW_ENVIRONMENT: CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ CMAKE_BUILD_PARALLEL_LEVEL=1 | |
CMAKE_C_COMPILER: /usr/local/opt/llvm/bin/clang | |
CMAKE_CXX_COMPILER: /usr/local/opt/llvm/bin/clang++ | |
- name: Build Wheels | |
if: runner.os == 'Windows' | |
run: | | |
python -m pip install cibuildwheel | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }} | |
CIBW_ARCHS: all | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_BUILD_VERBOSITY: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 1 | |
GITHUB_ACTIONS: ON | |
LIBRAPID_GET_BLAS: ON | |
LIBRAPID_GET_FFTW: OFF | |
CC: ${RUNNER_TOOL_CACHE}/llvm/bin/clang | |
CXX: ${RUNNER_TOOL_CACHE}/llvm/bin/clang++ | |
CIBW_ENVIRONMENT: CC=${RUNNER_TOOL_CACHE}/llvm/bin/clang CXX=${RUNNER_TOOL_CACHE}/llvm/bin/clang++ CMAKE_BUILD_PARALLEL_LEVEL=1 | |
CIBW_BEFORE_ALL: | | |
set CMAKE_BUILD_PARALLEL_LEVEL=1 | |
CMAKE_C_COMPILER: ${RUNNER_TOOL_CACHE}/llvm/bin/clang | |
CMAKE_CXX_COMPILER: ${RUNNER_TOOL_CACHE}/llvm/bin/clang++ | |
- name: Build Wheels | |
if: runner.os == 'Linux' | |
run: | | |
python -m pip install cibuildwheel | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: ${{ matrix.pythonType }}${{ matrix.pythonVersion }}-${{ matrix.platformID }} | |
CIBW_ARCHS: all | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_BUILD_VERBOSITY: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 1 | |
GITHUB_ACTIONS: ON | |
LIBRAPID_GET_BLAS: ON | |
LIBRAPID_GET_FFTW: OFF | |
CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=1 | |
- name: Store Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: wheelhouse/*.whl | |
# Build the source distribution under Linux | |
build_sdist: | |
name: Source Distribution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout LibRapid | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' # update once build dependencies are available | |
- name: Install Requirements | |
run: pip install -r requirements.txt | |
- name: Build Source Distribution | |
run: | | |
python -m build --sdist --outdir dist | |
twine check dist/*.tar.gz | |
- name: Store artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
# Upload the wheels and the source distribution | |
upload_artifacts: | |
name: Upload to PyPi | |
runs-on: ubuntu-latest | |
# needs: [build_wheels, build_wheels_cuda, build_sdist] | |
needs: [ build_wheels, build_sdist ] | |
# The artifacts cannot be uploaded on PRs | |
if: github.event_name != 'pull_request' | |
steps: | |
- name: Checkout LibRapid | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Install Requirements | |
run: pip install -r requirements.txt | |
- name: Upload Artifacts | |
continue-on-error: true | |
run: | | |
ls dist | |
twine upload --skip-existing dist/artifact/* -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} | |
# To uncomment: remove hash -- no space after!!! | |
# # Build the wheels for Linux and Windows with CUDA support | |
# build_wheels_cuda: | |
# name: Build wheel for ${{ matrix.cppp }}${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}-cuda${{ matrix.cuda_version }} | |
# runs-on: ${{ matrix.os }} | |
# needs: [run_linux_tests, run_macos_tests, run_windows_tests] | |
# if: needs.check_build_trigger.outputs.build | |
# | |
# strategy: | |
# # Ensure that a wheel builder finishes even if another fails | |
# fail-fast: false | |
# matrix: | |
# include: | |
# # Window 64 bit | |
# - os: windows-latest | |
# python: 37 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.4.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 37 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.5.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 37 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.6.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 37 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.7.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# | |
# - os: windows-latest | |
# python: 38 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.4.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 38 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.5.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 38 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.6.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 38 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.7.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# | |
# - os: windows-latest | |
# python: 39 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.4.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 39 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.5.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 39 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.6.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 39 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.7.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# | |
# - os: windows-latest | |
# python: 310 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.4.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 310 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.5.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 310 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.6.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# - os: windows-latest | |
# python: 310 | |
# bitness: 64 | |
# platform_id: win_amd64 | |
# cuda_version: "11.7.0" | |
# use_openblas: true | |
# cppp: "cp" | |
# | |
# steps: | |
# - name: Checkout LibRapid | |
# uses: actions/checkout@v4 | |
# with: | |
# submodules: recursive | |
# | |
# - name: Setup Python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: "3.9" # update once build dependencies are available | |
# | |
# - name: Install Requirements | |
# run: pip install -r requirements.txt | |
# | |
# - name: Clone OpenBLAS Build | |
# if: ${{ matrix.use_openblas }} | |
# uses: dawidd6/action-download-artifact@v2 | |
# with: | |
# workflow: build-openblas.yaml | |
# workflow_conclusion: success | |
# name: OpenBLAS on ${{ matrix.os }} | |
# path: src/librapid/openblas_install | |
# | |
# - name: Install CUDA-Toolkit | |
# uses: Jimver/[email protected] | |
# with: | |
# cuda: ${{ matrix.cuda_version }} | |
# | |
# - name: Build Wheels | |
# env: | |
# CIBW_BUILD: ${{ matrix.cppp }}${{ matrix.python }}-${{ matrix.platform_id }} | |
# CIBW_ARCHS: all | |
# CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
# CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
# CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
# CIBW_MANYLINUX_PYPY_I686_IMAGE: ${{ matrix.manylinux_image }} | |
# CIBW_TEST_SKIP: "*-macosx_arm64" | |
# CIBW_BUILD_VERBOSITY: 1 | |
# CMAKE_BUILD_PARALLEL_LEVEL: 1 | |
# LIBRAPID_CUDA_WHEEL: ${{ matrix.cuda_version }} | |
# LIBRAPID_CI_BUILD: true | |
# | |
# run: | | |
# python -m pip install cibuildwheel | |
# python -m cibuildwheel --output-dir wheelhouse | |
# | |
# - name: Store Artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# path: wheelhouse/*.whl |