diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 9ef608338d..b7d3692564 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -65,6 +65,11 @@ on: required: false type: boolean default: true + build-platform: + description: Platform to build wheels, choose from 'python-build-package' or 'setup-py' + required: false + type: string + default: 'setup-py' permissions: id-token: write @@ -167,21 +172,28 @@ jobs: cache-key: ${{ inputs.cache-key }} repository: ${{ inputs.repository }} script: ${{ inputs.pre-script }} - - name: Install python build dependency + - 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}" - # shellcheck disable=SC2086 + export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')" ${CONDA_RUN} python -m pip install build - - name: Build the wheel (bdist_wheel) + echo "Successfully installed Python build package" + ${CONDA_RUN} python -m build --wheel + - name: Build the wheel (setup-py) + if: ${{ inputs.build-platform == 'setup-py' }} working-directory: ${{ inputs.repository }} shell: bash -l {0} run: | set -euxo pipefail source "${BUILD_ENV_FILE}" - export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')" - ${CONDA_RUN} python -m build --wheel -n + export PYTORCH_VERSION="$(${CONDA_RUN} pip show torch | grep ^Version: | sed 's/Version: *//' | sed 's/+.\+//')" + ${CONDA_RUN} python setup.py clean + echo "Successfully ran `python setup.py clean`" + ${CONDA_RUN} python setup.py bdist_wheel - name: Run Post-Script if: ${{ inputs.post-script != '' }} uses: ./test-infra/.github/actions/run-script-with-cache diff --git a/.github/workflows/test_build_wheels_linux_without_cuda.yml b/.github/workflows/test_build_wheels_linux_without_cuda.yml index 9e5e60e8e3..e27ad416f9 100644 --- a/.github/workflows/test_build_wheels_linux_without_cuda.yml +++ b/.github/workflows/test_build_wheels_linux_without_cuda.yml @@ -43,3 +43,4 @@ jobs: build-matrix: ${{ needs.generate-matrix.outputs.matrix }} package-name: ${{ matrix.package-name }} trigger-event: "${{ github.event_name }}" + build-platform: 'python-build-package'