Skip to content

Commit c87f6ab

Browse files
authored
Fix smoke tests for macos arm64 (#4344)
Fix smoke tests for macos arm64 Fixes: #4342 This is caused by this issue: https://stackoverflow.com/questions/22773432/mac-using-default-python-despite-anaconda-install Here are some failures: https://github.com/pytorch/vision/actions/runs/5463754018/jobs/9944855459
1 parent 1c989d3 commit c87f6ab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/build_conda_macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ jobs:
177177
export CONDA_ENV_SMOKE="${RUNNER_TEMP}/pytorch_pkg_helpers_${GITHUB_RUN_ID}_smoke"
178178
conda create --yes --quiet --prefix "${CONDA_ENV_SMOKE}" python="${PYTHON_VERSION}"
179179
export CONDA_RUN_SMOKE="conda run -p ${CONDA_ENV_SMOKE}"
180+
export OLD_PATH=${PATH}
181+
export PATH="${CONDA_ENV_SMOKE}/bin:${PATH}"
180182
181183
CONDA_LOCAL_CHANNEL="file://$(readlink -f ${{ inputs.repository }}/distr)"
182184
${CONDA_RUN_SMOKE} conda install -v -y -c pytorch-${CHANNEL} -c "${CONDA_LOCAL_CHANNEL}" distr::"${PACKAGE_NAME}"
@@ -189,6 +191,7 @@ jobs:
189191
${CONDA_RUN_SMOKE} python3 "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
190192
fi
191193
194+
export PATH=${OLD_PATH}
192195
conda env remove -p "${CONDA_ENV_SMOKE}"
193196
- name: Upload package to conda
194197
if: ${{ (inputs.trigger-event == 'push' && env.CHANNEL != 'test') || (env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/')) }}

.github/workflows/build_wheels_macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ jobs:
181181
# Ensure that pytorch version is pinned, should output file where it was found
182182
grep "Requires-Dist: torch (==.*)" -r .
183183
)
184+
export OLD_PATH=${PATH}
185+
export PATH="${CONDA_ENV}/bin:${PATH}"
184186
185187
${CONDA_RUN} pip install "${{ inputs.repository }}/dist/$WHEEL_NAME"
186188
${CONDA_RUN} pip install numpy
@@ -197,6 +199,7 @@ jobs:
197199
${CONDA_RUN} conda install --yes --quiet ffmpeg
198200
${CONDA_RUN} python3 "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
199201
fi
202+
export PATH=${OLD_PATH}
200203
- name: Upload package to pytorch.org
201204
if: ${{ (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) || (env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/')) }}
202205
shell: bash -l {0}

0 commit comments

Comments
 (0)