Skip to content

Commit 387228a

Browse files
authored
Fix wheel macos arm64 validations (#1441)
* Fix wheel validations * Try using upgrade flag instead * try uninstall * test * Try using python3 * use python3 vs python for validation * Fix windows vs other os python execution * Uninstall fix
1 parent 6240da5 commit 387228a

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

.github/scripts/validate_binaries.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ else
66
conda create -y -n ${ENV_NAME} python=${MATRIX_PYTHON_VERSION} numpy ffmpeg
77
conda activate ${ENV_NAME}
88
INSTALLATION=${MATRIX_INSTALLATION/"conda install"/"conda install -y"}
9+
10+
# Make sure we remove previous installation if it exists
11+
if [[ ${MATRIX_PACKAGE_TYPE} == 'wheel' ]]; then
12+
pip3 uninstall -y torch torchaudio torchvision
13+
fi
914
eval $INSTALLATION
1015

1116
if [[ ${TARGET_OS} == 'linux' ]]; then
@@ -14,7 +19,12 @@ else
1419
${PWD}/check_binary.sh
1520
fi
1621

17-
python ./test/smoke_test/smoke_test.py
22+
if [[ ${TARGET_OS} == 'windows' ]]; then
23+
python ./test/smoke_test/smoke_test.py
24+
else
25+
python3 ./test/smoke_test/smoke_test.py
26+
fi
27+
1828
conda deactivate
1929
conda env remove -n ${ENV_NAME}
2030
fi

.github/workflows/validate-nightly-binaries.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ on:
1717
- .github/workflows/validate-macos-binaries.yml
1818
- .github/workflows/validate-macos-arm64-binaries.yml
1919
- test/smoke_test/*
20-
pull_request:
21-
paths:
22-
- .github/workflows/validate-nightly-binaries.yml
23-
- .github/workflows/validate-linux-binaries.yml
24-
- .github/workflows/validate-windows-binaries.yml
25-
- .github/workflows/validate-macos-binaries.yml
26-
- .github/workflows/validate-macos-arm64-binaries.yml
27-
- .github/scripts/validate_binaries.sh
28-
- test/smoke_test/*
20+
2921
jobs:
3022
nightly:
3123
uses: ./.github/workflows/validate-binaries.yml

.github/workflows/validate-release-binaries.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ on:
1717
- .github/workflows/validate-macos-binaries.yml
1818
- .github/workflows/validate-macos-arm64-binaries.yml
1919
- test/smoke_test/*
20+
pull_request:
21+
paths:
22+
- .github/workflows/validate-nightly-binaries.yml
23+
- .github/workflows/validate-linux-binaries.yml
24+
- .github/workflows/validate-windows-binaries.yml
25+
- .github/workflows/validate-macos-binaries.yml
26+
- .github/workflows/validate-macos-arm64-binaries.yml
27+
- .github/scripts/validate_binaries.sh
28+
- test/smoke_test/*
2029

2130
jobs:
2231
release:

test/smoke_test/smoke_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
channel = os.getenv("MATRIX_CHANNEL")
1717
stable_version = os.getenv("MATRIX_STABLE_VERSION")
1818
package_type = os.getenv("MATRIX_PACKAGE_TYPE")
19+
target_os = os.getenv("TARGET_OS")
1920

2021
is_cuda_system = gpu_arch_type == "cuda"
2122
NIGHTLY_ALLOWED_DELTA = 3
@@ -24,14 +25,14 @@
2425
{
2526
"name": "torchvision",
2627
"repo": "https://github.com/pytorch/vision.git",
27-
"smoke_test": "python ./vision/test/smoke_test.py",
28+
"smoke_test": "./vision/test/smoke_test.py",
2829
"extension": "extension",
2930
"repo_name": "vision",
3031
},
3132
{
3233
"name": "torchaudio",
3334
"repo": "https://github.com/pytorch/audio.git",
34-
"smoke_test": "python ./audio/test/smoke_test/smoke_test.py --no-ffmpeg",
35+
"smoke_test": "./audio/test/smoke_test/smoke_test.py --no-ffmpeg",
3536
"extension": "_extension",
3637
"repo_name": "audio",
3738
},
@@ -212,8 +213,11 @@ def smoke_test_modules():
212213
print(f"Path does not exist: {cwd}/{module['repo_name']}")
213214
subprocess.check_output(f"git clone --depth 1 {module['repo']}", stderr=subprocess.STDOUT, shell=True)
214215
try:
216+
smoke_test_command = f"python3 {module['smoke_test']}"
217+
if target_os == 'windows':
218+
smoke_test_command = f"python {module['smoke_test']}"
215219
output = subprocess.check_output(
216-
module["smoke_test"], stderr=subprocess.STDOUT, shell=True,
220+
smoke_test_command, stderr=subprocess.STDOUT, shell=True,
217221
universal_newlines=True)
218222
except subprocess.CalledProcessError as exc:
219223
raise RuntimeError(

0 commit comments

Comments
 (0)