Skip to content

Commit de221ef

Browse files
committed
Build/deploy/... scripts: improved WinPython detection
1 parent 2641a1a commit de221ef

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

scripts/run_unattended_tests.bat

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ if not defined WINPYDIRBASE ( goto :no )
1515
choice /t 5 /c yn /cs /d n /m "Do you want to run tests only from %WINPYDIRBASE% (y/n)?"
1616
if errorlevel 2 goto :no
1717
:yes
18-
call %WINPYDIRBASE%\scripts\env.bat
19-
python qwt/tests/__init__.py --mode unattended
18+
call :test %WINPYDIRBASE%
2019
pause
2120
exit /B %ERRORLEVEL%
2221
:no
23-
for /f %%f in ('dir /b c:\w*') do (call :test %%f)
22+
for /d %%d in (C:,C:\Apps,%localappdata%\Programs,%programfiles%,%ProgramFiles(x86)%) do (
23+
for /f %%f in ('dir /b %%d\w*') do (
24+
echo %%d\%%f
25+
call :test %%d\%%f
26+
)
27+
)
2428
pause
2529
exit /B %ERRORLEVEL%
2630

2731
:test
28-
set ENV=C:\%~1\scripts\env.bat
32+
set ENV=%~1\scripts\env.bat
2933
if exist %ENV% (
3034
@echo:
3135
@echo ************************** Testing with %~1 **************************

scripts/utils.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ goto:eof
3030
if defined WINPYDIRBASE (
3131
call %WINPYDIRBASE%\scripts\env.bat
3232
call :ShowTitle "Using WinPython from %WINPYDIRBASE%"
33+
) else (
34+
echo Warning: WINPYDIRBASE environment variable is not defined, switching to system Python
35+
echo ********
36+
echo (if nothing happens, that's probably because Python is not installed either:
37+
echo please set the WINPYDIRBASE variable to select WinPython directory, or install Python)
3338
)
3439
goto:eof
3540

0 commit comments

Comments
 (0)