Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 39 additions & 16 deletions .github/workflows/python-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
branches:
- main
- develop
types: [opened, reopened, labeled]
types: [labeled]

###################################
###################################
Expand All @@ -34,11 +34,18 @@ jobs:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
wheel_python_versions: ${{ steps.check.outputs.wheel_python_versions }}
wheel_python_sets: ${{ steps.check.outputs.wheel_python_sets }}
wheel_macos_runners: ${{ steps.check.outputs.wheel_macos_runners }}
steps:
- name: Evaluate trigger condition
id: check
env:
CHECK_EVENT_NAME: ${{ github.event_name }}
CHECK_GITHUB_REF: ${{ github.ref }}
run: |
EVENT_NAME="${{ github.event_name }}"
EVENT_NAME="$CHECK_EVENT_NAME"
GITHUB_REF="$CHECK_GITHUB_REF"

RAW_LABELS='${{ toJson(github.event.pull_request.labels) }}'
if [[ "$RAW_LABELS" == "null" || -z "$RAW_LABELS" ]]; then
Expand All @@ -48,13 +55,26 @@ jobs:
fi

SHOULD_RUN="true"
WHEEL_PYTHON_VERSIONS='["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]'
WHEEL_PYTHON_SETS='["cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313", "cp314-cp314"]'
WHEEL_MACOS_RUNNERS='["macos-14"]'

if [[ "$GITHUB_REF" == "refs/heads/main" || "$GITHUB_REF" == "refs/heads/develop" || "$GITHUB_REF" == refs/heads/release* || "$GITHUB_REF" == refs/tags/v* ]]; then
WHEEL_MACOS_RUNNERS='["macos-15-intel", "macos-14"]'
fi
Comment thread
aljazkonec1 marked this conversation as resolved.

if [[ "$EVENT_NAME" == "pull_request" ]]; then
WHEEL_PYTHON_VERSIONS='["3.14"]'
WHEEL_PYTHON_SETS='["cp314-cp314"]'
if ! echo "$LABELS" | jq -r '.[].name' | grep -q "testable"; then
SHOULD_RUN="false"
fi
fi

echo "should_run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
echo "wheel_python_versions=$WHEEL_PYTHON_VERSIONS" >> "$GITHUB_OUTPUT"
echo "wheel_python_sets=$WHEEL_PYTHON_SETS" >> "$GITHUB_OUTPUT"
echo "wheel_macos_runners=$WHEEL_MACOS_RUNNERS" >> "$GITHUB_OUTPUT"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Job which builds docstrings for the rest of the wheel builds
build-docstrings:
Expand Down Expand Up @@ -216,11 +236,11 @@ jobs:

# This job builds wheels for Windows x86_64 arch
build-windows-x86_64:
needs: build-docstrings
needs: [precheck, build-docstrings]
runs-on: windows-2022
strategy:
matrix:
python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ${{ fromJson(needs.precheck.outputs.wheel_python_versions) }}
python-architecture: [x64] # TODO(Morato) - re-enable x86
fail-fast: false
env:
Expand Down Expand Up @@ -306,11 +326,11 @@ jobs:

# This job builds wheels for macOS arch
build-macos:
needs: build-docstrings
needs: [precheck, build-docstrings]
strategy:
matrix:
python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14']
os: [macos-15-intel, macos-14]
python-version: ${{ fromJson(needs.precheck.outputs.wheel_python_versions) }}
os: ${{ fromJson(needs.precheck.outputs.wheel_macos_runners) }}
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -384,14 +404,17 @@ jobs:
path: bindings/python/wheelhouse/audited/*

combine-macos-wheels:
needs: build-macos
needs: [precheck, build-macos]
strategy:
matrix:
os: [macos-15-intel, macos-14]
os: ${{ fromJson(needs.precheck.outputs.wheel_macos_runners) }}
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.14"
Comment thread
aljazdu marked this conversation as resolved.
- name: Download audited wheels
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -431,15 +454,15 @@ jobs:

# This job builds wheels for x86_64 arch
build-linux-x86_64:
needs: build-docstrings
needs: [precheck, build-docstrings]
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_28_x86_64:2025.11.10-2
env:
PLAT: manylinux_2_28_x86_64
Comment thread
aljazdu marked this conversation as resolved.
strategy:
matrix:
python-set: ["cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313", "cp314-cp314"]
python-set: ${{ fromJson(needs.precheck.outputs.wheel_python_sets) }}
env:
DEPTHAI_BUILD_BASALT: ON
DEPTHAI_BUILD_PCL: ON
Expand Down Expand Up @@ -538,7 +561,7 @@ jobs:
run: |
set -euo pipefail

PYBIN="/opt/python/cp310-cp310/bin/python"
PYBIN="/opt/python/cp314-cp314/bin/python"

# Resolve the exact dev version (includes commit hash)
ver=$("$PYBIN" -c "import os,sys,pathlib; sys.path.insert(0, str(pathlib.Path('bindings/python').resolve())); import find_version as v; print(v.get_package_dev_version(os.environ['BUILD_COMMIT_HASH']))")
Expand All @@ -556,7 +579,7 @@ jobs:

# This job builds wheels for ARM64 arch
build-linux-arm64:
needs: build-docstrings
needs: [precheck, build-docstrings]
runs-on: ubuntu-24.04-arm
timeout-minutes: 1440 # Set timeout to 24 hours
container:
Expand All @@ -565,7 +588,7 @@ jobs:
PLAT: manylinux_2_28_aarch64
strategy:
matrix:
python-set: ["cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313", "cp314-cp314"]
python-set: ${{ fromJson(needs.precheck.outputs.wheel_python_sets) }}
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
VCPKG_FORCE_SYSTEM_BINARIES: "1" # Needed so vpckg can bootstrap itself
Expand Down Expand Up @@ -667,7 +690,7 @@ jobs:
run: |
set -euo pipefail

PYBIN="/opt/python/cp310-cp310/bin/python"
PYBIN="/opt/python/cp314-cp314/bin/python"

# Resolve the exact dev version (includes commit hash)
ver=$("$PYBIN" -c "import os,sys,pathlib; sys.path.insert(0, str(pathlib.Path('bindings/python').resolve())); import find_version as v; print(v.get_package_dev_version(os.environ['BUILD_COMMIT_HASH']))")
Expand Down Expand Up @@ -697,7 +720,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.14"
- name: Combine wheels
run: |
python -m pip install "delvewheel==1.12.1" # Install delvewheel for patching wheels
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@
]
}
},
"builtin-baseline": "a9eee3b18df395dbb8be71a31bd78ea441056e42"
"builtin-baseline": "d015e31e90838a4c9dfa3eed45979bc70d9357fc"
}
Loading