-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from nasa/cibuildwheel
Build python wheels with cibuildwheel. Will wait to publish to PyPI until pulling in python unit tests (separate ticket). For now, results are saved as GHA artifacts.
- Loading branch information
Showing
19 changed files
with
426 additions
and
377 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,120 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_wheels: | ||
name: ${{ matrix.os }}-${{ github.workflow }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
# tag '2023.04.15' | ||
vcpkgCommitId: '501db0f17ef6df184fcdbfbe0f87cde2313b6ab1' | ||
triplet: 'x64-linux-dynamic' | ||
- os: macos-latest | ||
# tag '2023.04.15' | ||
vcpkgCommitId: '501db0f17ef6df184fcdbfbe0f87cde2313b6ab1' | ||
triplet: 'x64-osx-dynamic' | ||
- os: windows-latest | ||
# tag '2023.04.15' | ||
vcpkgCommitId: '501db0f17ef6df184fcdbfbe0f87cde2313b6ab1' | ||
triplet: 'x64-windows' | ||
|
||
env: | ||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Special case: cibuildwheel uses docker container for | ||
# manylinux builds, so cache our vcpkg data on the | ||
# host filesystem (mounted to /host by default) | ||
- name: Point VCPKG_BINARY_SOURCES to host filesystem (Linux only) | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "VCPKG_BINARY_SOURCES=/host/${RUNNER_WORKSPACE}/b/vcpkg_cache" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: run vcpkg | ||
uses: lukka/run-vcpkg@main | ||
id: run_vcpkg | ||
with: | ||
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' | ||
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}' | ||
# 'runVcpkgInstall=false' is especially important in the case of Linux - | ||
# we need the cibuildwheel Docker container to actually build/install | ||
# the dependencies, even if they are stored on the host filesystem | ||
# (exposed via the /host mount point) and cached by the host runner. | ||
runVcpkgInstall: false | ||
vcpkgJsonGlob: '**/build-scripts/vcpkg.json' | ||
|
||
- name: List $RUNNER_WORKSPACE before build | ||
run: find $RUNNER_WORKSPACE | ||
shell: bash | ||
|
||
- name: Normalize paths (Windows only) | ||
if: runner.os == 'Windows' | ||
run: | | ||
echo "UNIX_RUNNER_WORKSPACE=${RUNNER_WORKSPACE//\\//}" >> $GITHUB_ENV | ||
echo "UNIX_GITHUB_WORKSPACE=${GITHUB_WORKSPACE//\\//}" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ENVIRONMENT_WINDOWS: >- | ||
SKBUILD_CONFIGURE_OPTIONS=' | ||
-DCMAKE_TOOLCHAIN_FILE=${{ env.UNIX_RUNNER_WORKSPACE }}/b/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | ||
-DVCPKG_INSTALLED_DIR=${{ env.UNIX_RUNNER_WORKSPACE }}/b/vcpkg_installed | ||
-DVCPKG_MANIFEST_DIR=${{ env.UNIX_GITHUB_WORKSPACE }}/build-scripts | ||
-DUPSP_BUILD_TESTING=OFF -DUPSP_BUILD_APPLICATIONS=OFF -DUPSP_BUILD_PYBIND11=ON' | ||
CIBW_ENVIRONMENT_MACOS: >- | ||
SKBUILD_CONFIGURE_OPTIONS=' | ||
-DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/b/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | ||
-DVCPKG_INSTALLED_DIR=${{ runner.workspace }}/b/vcpkg_installed | ||
-DVCPKG_MANIFEST_DIR=${{ github.workspace }}/build-scripts | ||
-DUPSP_BUILD_TESTING=OFF -DUPSP_BUILD_APPLICATIONS=OFF -DUPSP_BUILD_PYBIND11=ON' | ||
CIBW_ENVIRONMENT_LINUX: >- | ||
SKBUILD_CONFIGURE_OPTIONS=' | ||
-DCMAKE_TOOLCHAIN_FILE=/host/${{ runner.workspace }}/b/vcpkg/scripts/buildsystems/vcpkg.cmake | ||
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | ||
-DVCPKG_INSTALLED_DIR=/host/${{ runner.workspace }}/b/vcpkg_installed | ||
-DVCPKG_MANIFEST_DIR=/host/${{ github.workspace }}/build-scripts | ||
-DUPSP_BUILD_TESTING=OFF -DUPSP_BUILD_APPLICATIONS=OFF -DUPSP_BUILD_PYBIND11=ON' | ||
CIBW_BEFORE_ALL_LINUX: "yum install -y perl-IPC-Cmd zip ninja-build" | ||
CIBW_BEFORE_BUILD_WINDOWS: "pip install cmake" | ||
CIBW_BUILD: "cp39-win_amd64 cp39-macosx_x86_64 cp39-manylinux_x86_64" | ||
CIBW_SKIP: "*-win32 *-manylinux_i686" | ||
CIBW_BUILD_VERBOSITY: 1 | ||
with: | ||
package-dir: . | ||
output-dir: wheelhouse | ||
config-file: "{package}/pyproject.toml" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # for setuptools_scm | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz |
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
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,31 @@ | ||
#!/bin/bash | ||
|
||
VCPKG_ROOT=/opt/vcpkg | ||
VCPKG_TRIPLET="x64-linux-dynamic" | ||
|
||
echo "Settings up vcpkg in '$VCPKG_ROOT' ..." | ||
|
||
yum install -y \ | ||
perl-IPC-Cmd \ | ||
zip | ||
|
||
if [ ! -e "$VCPKG_ROOT" ]; then | ||
git clone \ | ||
--depth 1 \ | ||
--branch "2023.04.15" \ | ||
https://github.com/Microsoft/vcpkg.git \ | ||
$VCPKG_ROOT | ||
|
||
pushd . | ||
cd $VCPKG_ROOT | ||
./bootstrap-vcpkg.sh -disableMetrics | ||
popd | ||
fi | ||
|
||
pushd . | ||
cd $VCPKG_ROOT | ||
./vcpkg install --triplet=$VCPKG_TRIPLET \ | ||
imath[core] \ | ||
pybind11[core] | ||
|
||
popd |
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,27 @@ | ||
#!/bin/bash | ||
|
||
VCPKG_ROOT=$PWD/vcpkg | ||
VCPKG_TRIPLET="x64-osx-dynamic" | ||
|
||
echo "Settings up vcpkg in '$VCPKG_ROOT' ..." | ||
|
||
if [ ! -e "$VCPKG_ROOT" ]; then | ||
git clone \ | ||
--depth 1 \ | ||
--branch "2023.04.15" \ | ||
https://github.com/Microsoft/vcpkg.git \ | ||
$VCPKG_ROOT | ||
|
||
pushd . | ||
cd $VCPKG_ROOT | ||
./bootstrap-vcpkg.sh -disableMetrics | ||
popd | ||
fi | ||
|
||
pushd . | ||
cd $VCPKG_ROOT | ||
./vcpkg install --triplet=$VCPKG_TRIPLET \ | ||
imath[core] \ | ||
pybind11[core] | ||
|
||
popd |
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,7 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
"dependencies": [ | ||
"imath", | ||
"pybind11" | ||
] | ||
} |
Oops, something went wrong.