forked from davisking/dlib
-
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.
- Loading branch information
Jan Stiborek
committed
Sep 9, 2024
1 parent
fafdac3
commit 5f8c525
Showing
3 changed files
with
101 additions
and
2 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 |
---|---|---|
|
@@ -77,4 +77,3 @@ jobs: | |
# python3 setup.py install --user | ||
# - name: Test | ||
# run: python3 -m pytest --ignore docs --ignore dlib | ||
|
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,100 @@ | ||
name: Python wheels | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/build_python.yml" | ||
- "**.cpp" | ||
- "**.h" | ||
- "**.c" | ||
- "**.cu" | ||
- "**.cmake" | ||
- "**CMakeLists.txt" | ||
- "**py" | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/build_python.yml" | ||
- "**.cpp" | ||
- "**.h" | ||
- "**.c" | ||
- "**.cu" | ||
- "**.cmake" | ||
- "**CMakeLists.txt" | ||
- "**py" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build_wheels_matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
include: ${{ steps.set-matrix.outputs.include }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- run: pip install cibuildwheel==2.20.0 # sync version with pypa/cibuildwheel below | ||
- id: set-matrix | ||
env: | ||
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.7' # it is missing in setup.py and needed to determine which wheels to build | ||
run: | | ||
MATRIX_INCLUDE=$( | ||
{ | ||
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ | ||
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-13"}' \ | ||
&& cibuildwheel --print-build-identifiers --platform macos --arch arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-14"}' \ | ||
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}' | ||
} | jq -sc | ||
) | ||
echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT | ||
build_wheels: | ||
needs: build_wheels_matrix | ||
runs-on: ${{ matrix.os }} | ||
name: Build ${{ matrix.only }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJson(needs.build_wheels_matrix.outputs.include) }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Disable gui support | ||
run: | | ||
sed -i'' -e "s/_cmake_extra_options = \[\]/_cmake_extra_options = \['-DDLIB_NO_GUI_SUPPORT=ON'\]/" setup.py | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- uses: pypa/cibuildwheel@v2.20.0 # sync version with pip install cibuildwheel above | ||
with: | ||
only: ${{ matrix.only }} | ||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_TEST_COMMAND: python -c "import dlib" | ||
|
||
# Disabled for now since something is going sideways with python packages on github actions | ||
# MacOS: | ||
# runs-on: 'macos-latest' | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# - name: Install python deps | ||
# run: pip3 install pytest numpy | ||
# - name: Build | ||
# run: | | ||
# python3 setup.py build | ||
# python3 setup.py install --user | ||
# - name: Test | ||
# run: python3 -m pytest --ignore docs --ignore dlib | ||
|
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,3 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
requires = ["setuptools", "wheel", "cmake==3.24.0"] | ||
build-backend = "setuptools.build_meta" |