Skip to content

Commit fdcd2e5

Browse files
authored
Add python-build-package variant to windows wheel building (#7256)
In #6352, building of wheels for win-arm64 was added. This PR aligns the naming in the workflow more closely with the rest of the workflow file and adds the more modern `python -m build` variant to the previously used direct invocation of `setup.py bdist_wheel` as is done for other platforms.
1 parent acb8d0f commit fdcd2e5

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

.github/workflows/build_wheels_windows.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ on:
5555
build-command:
5656
description: The build command to use if build-platform is python-build-package
5757
required: false
58-
default: "python -m build --wheel"
58+
default: "python -m build --wheel --no-isolation"
5959
type: string
6060
trigger-event:
6161
description: "Trigger Event in caller that determines whether or not to upload"
@@ -274,8 +274,26 @@ jobs:
274274
else
275275
${CONDA_RUN} ${ENV_SCRIPT} python setup.py bdist_wheel ${BUILD_PARAMS}
276276
fi
277-
- name: Build the wheel (bdist_wheel) Arm64
278-
if: inputs.architecture == 'arm64'
277+
- name: Build the wheel (python-build-package) Arm64
278+
if: ${{ inputs.build-platform == 'python-build-package' && inputs.architecture == 'arm64' }}
279+
env:
280+
SRC_DIR: ${{ inputs.repository }}
281+
DEPENDENCIES_DIR: c:\temp\dependencies\
282+
shell: cmd
283+
run: |
284+
set CONDA_PREFIX=%DEPENDENCIES_DIR%
285+
set PATH=%PATH%;%DEPENDENCIES_DIR%\Library\bin
286+
set DISTUTILS_USE_SDK=1
287+
set VS_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
288+
289+
call "%VS_PATH%" arm64
290+
cd %SRC_DIR%
291+
call .venv\Scripts\activate.bat
292+
293+
pip install --upgrade setuptools==72.1.0 build==1.2.2 wheel
294+
${{ inputs.build-command }}
295+
- name: Build the wheel (setup-py) Arm64
296+
if: ${{ inputs.build-platform == 'setup-py' && inputs.architecture == 'arm64' }}
279297
env:
280298
SRC_DIR: ${{ inputs.repository }}
281299
DEPENDENCIES_DIR: c:\temp\dependencies\

.github/workflows/test_build_wheels_windows_arm64.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ jobs:
3333
smoke-test-script: test/smoke_test.py
3434
package-name: torchvision
3535
architecture: "arm64"
36+
build-platform: setup-py
37+
- repository: pytorch/vision
38+
pre-script: packaging/pre_build_script_arm64.sh
39+
smoke-test-script: test/smoke_test.py
40+
package-name: torchvision
41+
architecture: "arm64"
42+
build-platform: python-build-package
3643
uses: ./.github/workflows/build_wheels_windows.yml
3744
name: ${{ matrix.repository }}
3845
with:
@@ -45,4 +52,5 @@ jobs:
4552
smoke-test-script: ${{ matrix.smoke-test-script }}
4653
package-name: ${{ matrix.package-name }}
4754
trigger-event: "${{ github.event_name }}"
48-
architecture: ${{ matrix.architecture }}
55+
architecture: ${{ matrix.architecture }}
56+
build-platform: ${{ matrix.build-platform }}

0 commit comments

Comments
 (0)