File tree 10 files changed +66
-14
lines changed
10 files changed +66
-14
lines changed Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
rem runlint < base commit> [< output file> ]
3
3
rem Lints any changes after base commit up to and including current HEAD, plus any uncommitted changes.
4
- call " %~dp0 \venvUtils\venvCmd.bat" py " %~dp0 \tests\lint\genDiff.py" %1 " %~dp0 \tests\lint\_lint.diff"
4
+ set hereOrig = %~dp0
5
+ set here = %hereOrig%
6
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
7
+ set scriptsDir = %here% \venvUtils
8
+ set lintFilesPath = %here% \tests\lint
9
+
10
+ call " %scriptsDir% \venvCmd.bat" py " %lintFilesPath% \genDiff.py" %1 " %lintFilesPath% \_lint.diff"
5
11
if ERRORLEVEL 1 exit /b %ERRORLEVEL%
6
- set flake8Args = --diff --config=" %~dp0 \tests\lint \flake8.ini"
12
+ set flake8Args = --diff --config=" %lintFilesPath% \flake8.ini"
7
13
if " %2 " NEQ " " set flake8Args = %flake8Args% --tee --output-file=%2
8
- type " %~dp0 \tests\lint\ _lint.diff" | call " %~dp0 \venvUtils \venvCmd.bat" py -Xutf8 -m flake8 %flake8Args%
14
+ type " %lintFilesPath% \ _lint.diff" | call " %scriptsDir% \venvCmd.bat" py -Xutf8 -m flake8 %flake8Args%
9
15
Original file line number Diff line number Diff line change 1
1
@ echo off
2
- call " %~dp0 \venvUtils\venvCmd.bat" start pyw " %~dp0 \source\nvda.pyw" %*
2
+ set hereOrig = %~dp0
3
+ set here = %hereOrig%
4
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
5
+ set scriptsDir = %here% \venvUtils
6
+ set sourceDirPath = %here% \source
7
+
8
+ call " %scriptsDir% \venvCmd.bat" start pyw " %sourceDirPath% \nvda.pyw" %*
Original file line number Diff line number Diff line change 1
1
@ echo off
2
- call " %~dp0 \venvUtils\venvCmd.bat" py -m robot --argumentfile " %~dp0 \tests\system\guiDiff.robot" %* " %~dp0 \tests\system\robot"
2
+ set hereOrig = %~dp0
3
+ set here = %hereOrig%
4
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
5
+ set scriptsDir = %here% \venvUtils
6
+ set systemTestsPath = %here% \tests\system
7
+
8
+ call " %scriptsDir% \venvCmd.bat" py -m robot --argumentfile " %systemTestsPath% \guiDiff.robot" %* " %systemTestsPath% \robot"
Original file line number Diff line number Diff line change 1
1
@ echo off
2
- call " %~dp0 \venvUtils\venvCmd.bat" py -m robot --argumentfile " %~dp0 \tests\system\robotArgs.robot" %* " %~dp0 \tests\system\robot"
2
+ set hereOrig = %~dp0
3
+ set here = %hereOrig%
4
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
5
+ set scriptsDir = %here% \venvUtils
6
+ set systemTestsPath = %here% \tests\system
3
7
8
+ call " %scriptsDir% \venvCmd.bat" py -m robot --argumentfile " %systemTestsPath% \robotArgs.robot" %* " %systemTestsPath% \robot"
Original file line number Diff line number Diff line change 1
1
@ echo off
2
- call " %~dp0 \venvUtils\venvCmd.bat" py -m nose -sv --traverse-namespace -w " %~dp0 \tests\unit" %*
2
+ set hereOrig = %~dp0
3
+ set here = %hereOrig%
4
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
5
+ set scriptsDir = %here% \venvUtils
6
+ set unitTestsPath = %here% \tests\unit
7
+
8
+ call " %scriptsDir% \venvCmd.bat" py -m nose -sv --traverse-namespace -w " %unitTestsPath% " %*
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
rem Executes SScons within the NVDA build system's Python virtual environment.
3
- call " %~dp0 \venvUtils\venvCmd.bat" py -m SCons %*
3
+ set hereOrig = %~dp0
4
+ set here = %hereOrig%
5
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
6
+ set scriptsDir = %here% \venvUtils
7
+ call " %scriptsDir% \venvCmd.bat" py -m SCons %*
Original file line number Diff line number Diff line change 30
30
EVENT_E_ALL_SUBSCRIBERS_FAILED = - 2147220991
31
31
LOAD_WITH_ALTERED_SEARCH_PATH = 0x8
32
32
33
- def isPathExternalToNVDA (path ):
33
+
34
+ def isPathExternalToNVDA (path : str ) -> bool :
34
35
""" Checks if the given path is external to NVDA (I.e. not pointing to built-in code). """
35
- if path [0 ] != "<" and os .path .isabs (path ) and not path .startswith (sys .path [0 ] + "\\ " ):
36
+ if (
37
+ path [0 ] != "<"
38
+ and os .path .isabs (path )
39
+ and not os .path .normpath (path ).startswith (sys .path [0 ] + "\\ " )
40
+ ):
36
41
# This module is external because:
37
42
# the code comes from a file (fn doesn't begin with "<");
38
43
# it has an absolute file path (code bundled in binary builds reports relative paths); and
Original file line number Diff line number Diff line change 2
2
rem this script ensures the NVDA build system Python virtual environment is created and up to date,
3
3
rem and then activates it.
4
4
rem This is an internal script and should not be used directly.
5
+ set hereOrig = %~dp0
6
+ set here = %hereOrig%
7
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
8
+ set scriptsDir = %here%
9
+ set venvLocation = %here% \..\.venv
5
10
6
11
rem Ensure the environment is created and up to date
7
- py -3.7-32 " %~dp0 \ensureVenv.py"
12
+ py -3.7-32 " %scriptsDir% \ensureVenv.py"
8
13
if ERRORLEVEL 1 goto :EOF
9
14
10
15
rem Set the necessary environment variables to have Python use this virtual environment.
@@ -18,7 +23,7 @@ rem set the VIRTUAL_ENV variable instructing Python to use a virtual environment
18
23
rem py.exe will honor VIRTUAL_ENV and launch the python.exe that it finds in %VIRTUAL_ENV%\scripts.
19
24
rem %VIRTUAL_ENV%\scripts\python.exe will find pyvenv.cfg in its parent directory,
20
25
rem which is actually what then causes Python to use the site-packages found in this virtual environment.
21
- set VIRTUAL_ENV = %~dp0 ..\.venv
26
+ set VIRTUAL_ENV = %venvLocation%
22
27
rem Add the virtual environment's scripts directory to the path
23
28
set PATH = %VIRTUAL_ENV% \scripts;%PATH%
24
29
rem Set an NVDA-specific variable to identify this official NVDA virtual environment from other 3rd party ones
Original file line number Diff line number Diff line change 1
1
@ echo off
2
+ set hereOrig = %~dp0
3
+ set here = %hereOrig%
4
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
5
+ set scriptsDir = %here%
6
+
2
7
setlocal
3
8
if " %VIRTUAL_ENV% " == " " (
4
- call " %~dp0 \ensureAndActivate.bat"
9
+ call " %scriptsDir% \ensureAndActivate.bat"
5
10
if ERRORLEVEL 1 goto :EOF
6
11
)
7
12
py -m pip freeze > %1
Original file line number Diff line number Diff line change @@ -15,12 +15,16 @@ if "%VIRTUAL_ENV%" NEQ "" (
15
15
call %*
16
16
goto :EOF
17
17
)
18
+ set hereOrig = %~dp0
19
+ set here = %hereOrig%
20
+ if #%hereOrig:~-1 % # == #\# set here = %hereOrig:~0 ,-1 %
21
+ set scriptsDir = %here%
18
22
19
23
rem call setlocal to make sure that any environment variable changes made by activating the virtual environment
20
24
rem can be completely undone when endlocal is called or this script exits.
21
25
setlocal
22
26
echo Ensuring NVDA Python virtual environment
23
- call " %~dp0 \ensureAndActivate.bat"
27
+ call " %scriptsDir% \ensureAndActivate.bat"
24
28
if ERRORLEVEL 1 goto :EOF
25
29
echo call %*
26
30
call %*
You can’t perform that action at this time.
0 commit comments