Skip to content

Commit 9da7585

Browse files
committed
Fix conda Windows smoke_test
PYTORCH_BUILD_VERSION can be different then the downloaded artifact
1 parent b8539eb commit 9da7585

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

windows/internal/smoke_test.bat

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,21 @@ call %CONDA_HOME%\condabin\activate.bat testenv
9393
if errorlevel 1 exit /b 1
9494
set "NO_ARCH_PATH=%PYTORCH_FINAL_PACKAGE_DIR:/=\%\noarch"
9595
mkdir %NO_ARCH_PATH%
96-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *') do xcopy "%%i" %NO_ARCH_PATH% /Y
97-
if ERRORLEVEL 1 exit /b 1
96+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *') do (
97+
echo Processing file: %%i
98+
:: Extract the version number from the file name
99+
for /f "tokens=2 delims=-" %%a in ("%%~nxi") do (
100+
set "PYTORCH_VERSION=%%a"
101+
echo Version set to: %%a
102+
)
103+
xcopy "%%i" %NO_ARCH_PATH% /Y
104+
)
105+
if errorlevel 1 exit /b 1
106+
98107
call conda index %PYTORCH_FINAL_PACKAGE_DIR%
99108
if errorlevel 1 exit /b 1
100-
call conda install -yq -c "file:///%PYTORCH_FINAL_PACKAGE_DIR%" pytorch==%PYTORCH_BUILD_VERSION% -c pytorch -c numba/label/dev -c nvidia
109+
110+
call conda install -yq -c "file:///%PYTORCH_FINAL_PACKAGE_DIR%" pytorch==%PYTORCH_VERSION% -c pytorch -c numba/label/dev -c nvidia
101111
if ERRORLEVEL 1 exit /b 1
102112
call conda install -yq numpy
103113
if ERRORLEVEL 1 exit /b 1

0 commit comments

Comments
 (0)