Skip to content

Commit

Permalink
[Cherry-pick for release/2.5] (#5931)
Browse files Browse the repository at this point in the history
2 cherry-picks below needed for torchcodec.

---------

Co-authored-by: Scott Schneider <[email protected]>
  • Loading branch information
NicolasHug and scotts authored Nov 18, 2024
1 parent a3571a1 commit b6da80a
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ on:
description: "Name of the actual python package that is imported"
default: ""
type: string
build-platform:
description: Platform to build wheels, choose from 'python-build-package' or 'setup-py'
required: false
type: string
default: 'setup-py'
build-command:
description: The build command to use if build-platform is python-build-package
required: false
default: "python -m build --wheel"
type: string
env-var-script:
description: "Script that sets Domain-Specific Environment Variables"
default: ""
Expand All @@ -64,6 +74,11 @@ on:
required: false
type: string
default: recursive
setup-miniconda:
description: Set to true if setup-miniconda is needed
required: false
type: boolean
default: false
delocate-wheel:
description: "Whether to run delocate-wheel after building."
required: false
Expand Down Expand Up @@ -116,7 +131,7 @@ jobs:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
submodules: ${{ inputs.submodules }}
setup-miniconda: false
setup-miniconda: ${{ inputs.setup-miniconda }}
python-version: ${{ env.PYTHON_VERSION }}
cuda-version: ${{ env.CU_VERSION }}
arch: ${{ env.ARCH }}
Expand Down Expand Up @@ -152,7 +167,27 @@ jobs:
# shellcheck disable=SC1090
source "${BUILD_ENV_FILE}"
${CONDA_RUN} python3 setup.py clean
- name: Build the wheel (bdist_wheel)
- name: Build the wheel (python-build-package)
if: ${{ inputs.build-platform == 'python-build-package' }}
working-directory: ${{ inputs.repository }}
shell: bash -l {0}
run: |
set -euxo pipefail
# shellcheck disable=SC1090
source "${BUILD_ENV_FILE}"
if [[ "${{ inputs.package-name }}" = "torchaudio" ]]; then
export USE_OPENMP="0"
fi
PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//')"
export PYTORCH_VERSION
${CONDA_RUN} python -m pip install build
echo "Successfully installed Python build package"
${CONDA_RUN} ${{ inputs.build-command }}
- name: Build the wheel (setup-py)
if: ${{ inputs.build-platform == 'setup-py' }}
working-directory: ${{ inputs.repository }}
run: |
set -euxo pipefail
Expand Down

0 comments on commit b6da80a

Please sign in to comment.