-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e85b880
commit 617870a
Showing
8 changed files
with
116 additions
and
70 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Relevant GHA docs links: | ||
# https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container | ||
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio | ||
|
||
name: Build PyPI package | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
concurrency: | ||
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-halide: | ||
name: Build Halide | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
arch: [ x86_64, i686, aarch64 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2.0.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.10.2 | ||
env: | ||
CIBW_ARCHS_LINUX: "${{ matrix.arch }}" | ||
CIBW_BUILD: "cp38-manylinux* cp39-manylinux* cp310-manylinux*" | ||
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/halide/manylinux2014_x86_64-llvm:15.0.1 | ||
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/halide/manylinux2014_i686-llvm:15.0.1 | ||
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/halide/manylinux2014_aarch64-llvm:15.0.1 | ||
CIBW_BEFORE_ALL_LINUX: > | ||
cmake -G Ninja -S . -B build | ||
-DCMAKE_BUILD_TYPE=Release -DWITH_DOCS=NO -DWITH_PYTHON_BINDINGS=NO -DWITH_TESTS=NO | ||
-DWITH_TUTORIALS=NO -DWITH_UTILS=NO && | ||
cmake --build build --target install | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
graft python_bindings | ||
prune python_bindings/test | ||
prune python_bindings/tutorial |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
export CIBW_PLATFORM=linux | ||
|
||
export CIBW_ARCHS="x86_64 i686 aarch64" | ||
export CIBW_BUILD="cp38-manylinux* cp39-manylinux* cp310-manylinux*" | ||
|
||
export CIBW_MANYLINUX_X86_64_IMAGE=ghcr.io/halide/manylinux2014_x86_64-llvm:15.0.1 | ||
export CIBW_MANYLINUX_I686_IMAGE=ghcr.io/halide/manylinux2014_i686-llvm:15.0.1 | ||
export CIBW_MANYLINUX_AARCH64_IMAGE=ghcr.io/halide/manylinux2014_aarch64-llvm:15.0.1 | ||
|
||
export CIBW_BEFORE_ALL="\ | ||
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_DOCS=NO -DWITH_PYTHON_BINDINGS=NO -DWITH_TESTS=NO \ | ||
-DWITH_TUTORIALS=NO -DWITH_UTILS=NO && \ | ||
cmake --build build --target install" | ||
|
||
cibuildwheel --print-build-identifiers |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools>=43", | ||
"wheel", | ||
"scikit-build", | ||
"pybind11==2.6.2", | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake>=3.22 | ||
imageio | ||
ninja; platform_system!='Windows' | ||
numpy | ||
pillow | ||
pybind11==2.6.2 | ||
scikit-build | ||
scipy | ||
setuptools>=43 | ||
wheel | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pybind11 | ||
from setuptools import find_packages | ||
from skbuild import setup | ||
|
||
setup( | ||
name="halide", | ||
version='15.0.0', | ||
author="The Halide team", | ||
author_email="", | ||
description="", | ||
long_description="", | ||
python_requires=">=3.6", | ||
packages=find_packages(where="python_bindings/src"), | ||
package_dir={"": "python_bindings/src"}, | ||
cmake_source_dir="python_bindings", | ||
cmake_args=[ | ||
f"-Dpybind11_ROOT={pybind11.get_cmake_dir()}", | ||
"-DCMAKE_REQUIRE_FIND_PACKAGE_pybind11=YES", | ||
"-DHalide_INSTALL_PYTHONDIR=python_bindings/src", | ||
"-DCMAKE_INSTALL_RPATH=$<IF:$<PLATFORM_ID:Darwin>,@loader_path,$ORIGIN>", | ||
"-DHalide_Python_INSTALL_IMPORTED_DEPS=ON", | ||
"-DWITH_TESTS=NO", | ||
"-DWITH_TUTORIALS=NO", | ||
"--no-warn-unused-cli", | ||
], | ||
) |