Skip to content
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
adf131a
Build NVDA with Python 3.8 32-bit (#12042)
josephsl Feb 15, 2021
5e87120
Remove any git submodules to distributions we can instead fetch with …
michaelDCurran Feb 15, 2021
c8fc42b
List all required Python packages in a requirements.txt in the root o…
michaelDCurran Feb 15, 2021
9c9d1e1
Ssconscripts: import SCons correctly.
michaelDCurran Feb 15, 2021
3878133
Appveyor: Create and activate a Python virtual environment. Also use …
michaelDCurran Feb 15, 2021
90a7183
Update readme.md
michaelDCurran Feb 15, 2021
cd4a3cf
appveyor.yml: no need to specifify python version in specific command…
michaelDCurran Feb 16, 2021
9503492
.gitignore: ignore the .venv directory
michaelDCurran Feb 16, 2021
fd890d3
setup.py: don't package numpy with NVDA.
michaelDCurran Feb 16, 2021
4a852d9
Use py2exe 0.10.1.0 rather than py2exe 0.10.2.0 which seems to actual…
michaelDCurran Feb 16, 2021
5795e76
Python 3.8/liblouis helper: add NVDA executable path by calling os.ad…
josephsl Feb 16, 2021
6d58baa
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran Feb 16, 2021
3025d74
Use comtypes 1.1.7.
michaelDCurran Feb 16, 2021
8074fa1
System tests: don't specify Python 3.7 when running system tests with…
michaelDCurran Feb 16, 2021
c22b7b3
appveyor: run nose with the --traverse-namespace option as it is now …
michaelDCurran Feb 17, 2021
0179e48
Update to miscDeps containing brlAPI for Python 3.8
michaelDCurran Feb 17, 2021
f70b0e8
Work around for issue #12058: In wxPython >= 4.1, wx.CallAfter no lon…
michaelDCurran Feb 17, 2021
cbd21be
Merge remote-tracking branch 'origin/py3.8' into py3.8_manualVenv
michaelDCurran Feb 17, 2021
6f427af
Explicitly include xmlrpc.server with py2exe, as it is required for s…
michaelDCurran Feb 17, 2021
e59018e
sourceEnv: stop the user from running with no virtual environment.
michaelDCurran Feb 22, 2021
daf53a1
Integrate the Python virtual environment transparently into the build…
michaelDCurran Feb 24, 2021
ef52123
Fix typo
michaelDCurran Feb 24, 2021
e7a54fd
ensureVenv.py: flush standard out before running any sub processes ot…
michaelDCurran Feb 24, 2021
713397c
remove some unneeded imports.
michaelDCurran Feb 25, 2021
c60975e
Update pip within the virtual environment, not before, as a stock-sta…
michaelDCurran Feb 25, 2021
da159ae
ensureVenv: address review commnts.
michaelDCurran Feb 25, 2021
2a9df26
core.main: FreeConsole returns 0 on failure rather than raising an ex…
michaelDCurran Feb 25, 2021
459e3a3
Added runnvdaw.bat which runs NVDA without blocking. this provides th…
michaelDCurran Feb 25, 2021
12ae5a8
Merge branch 'master' into py3.8
michaelDCurran Mar 1, 2021
ada0b85
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran Mar 1, 2021
73c8490
appveyor: push the list of installed python packages directly as an …
michaelDCurran Mar 1, 2021
19120dd
linting for venvUtils/ensureVenv.py
michaelDCurran Mar 1, 2021
e924a87
Linting for source/setup.py
michaelDCurran Mar 1, 2021
1b827b6
add rununittests.bat to provide a faster way of running the unit test…
michaelDCurran Mar 1, 2021
1039dc5
Add runsystemtests.bat as a quick way of running the system tests, wi…
michaelDCurran Mar 1, 2021
8a13814
Add runlint.bat which provides a quicker way of linting. Rather than …
michaelDCurran Mar 1, 2021
91193e2
Add diff-match-patch as a Python package requirement as NVDA_DMP need…
michaelDCurran Mar 3, 2021
f47db8e
Sync with latest nvda_dmp. (#12113)
codeofdusk Mar 3, 2021
8375c3e
Cnfigobj is now fetched by pip, rather than it being a git submodule.
michaelDCurran Mar 3, 2021
2f01c39
Address review comments: final line ending / extra spaces.
michaelDCurran Mar 3, 2021
f1eb3e9
venvCmd.bat: allow executing a command when already inside an NVDA Py…
michaelDCurran Mar 3, 2021
89922ec
appveyor: abort on failure of scons and other commands.
michaelDCurran Mar 3, 2021
b834a4e
Ensure that scons.bat and other high-level commands correctly propaga…
michaelDCurran Mar 3, 2021
2039871
Revert "core.main: FreeConsole returns 0 on failure rather than raisi…
michaelDCurran Mar 4, 2021
e2e23ed
core.main: revert addition of FreeConsole. This will be handled in a …
michaelDCurran Mar 4, 2021
34e7107
For now runnvda.bat (python) has been removed, and runnvdaw.bat (pyth…
michaelDCurran Mar 4, 2021
711eb37
garbageHandler: revert fix to "Nonetype is not callable" when Python …
michaelDCurran Mar 4, 2021
ed432bf
Remove targets for unit tests, system tests and linting from SCons as…
michaelDCurran Mar 4, 2021
b0cb717
Appveyor now calls runlint, rununittests and runsystemtests rather th…
michaelDCurran Mar 7, 2021
7eb2584
Update system tests readme to talk about runsystemtests, and not SCons.
michaelDCurran Mar 7, 2021
ee498f3
readme: briefly mention Nose and Robot and providing them extra argum…
michaelDCurran Mar 7, 2021
7b125c6
tests/sconscript: remove all code unrelated to checkPot.
michaelDCurran Mar 7, 2021
b59263d
appveyor: call our batch files as a relative path otherise Powershell…
michaelDCurran Mar 7, 2021
e820763
appveyor: py3.8 is a branch we should run builds for.
michaelDCurran Mar 7, 2021
d8a89c0
runlint.bat: fix path.
michaelDCurran Mar 7, 2021
d5e480c
add a description of the build system to the devDocs directory.
michaelDCurran Mar 7, 2021
e0f9c6b
NVDA build system commands no longer refuse to run if not in NVDA's s…
michaelDCurran Mar 8, 2021
c6c13e0
Linting
michaelDCurran Mar 8, 2021
dd70ba8
Apply suggestions from code review
michaelDCurran Mar 8, 2021
95339d6
System tests: use runnvda.bat rather than pyw source\nvda.pyw directly.
michaelDCurran Mar 8, 2021
9ab0f6d
scons dist: copy crt dlls from the latest installed sdk (I.e. the one…
michaelDCurran Mar 9, 2021
e008f1d
appveyor: Move generation of the installed_python_packages.txt file t…
michaelDCurran Mar 9, 2021
110edc1
Call pip freeze from a batch file in appveyor, as it seems that power…
michaelDCurran Mar 9, 2021
778e512
Update buildSystemNotes
feerrenrut Mar 10, 2021
06411a0
buildSystemNotes: address some typos.
michaelDCurran Mar 11, 2021
9b1c16a
Remove workaround for issue #9762 (#12142)
lukaszgo1 Mar 11, 2021
cc7d219
Python 3.8: Mention additional system requirements for Windows 7 (#12…
lukaszgo1 Mar 11, 2021
0b78587
Python 3.8/gettext: replace custom pgettext implementation with built…
josephsl Mar 11, 2021
0dbdaed
Merge branch 'master' into py3.8
michaelDCurran Mar 11, 2021
49ea5ae
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran Mar 11, 2021
7a6fc4d
Update what's new
michaelDCurran Mar 11, 2021
cca866a
appveyor: remove mention of py3.8 branch, no longer needed.
michaelDCurran Mar 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ tests/unit/nvda.ini
source/locale/*/cldr.dic
.vscode
.vs
.venv
19 changes: 0 additions & 19 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,9 @@
path = include/sonic
url = https://github.com/waywardgeek/sonic.git
ignore = untracked
[submodule "include/pyserial"]
path = include/pyserial
url = https://github.com/pyserial/pyserial.git
ignore = untracked
[submodule "include/comtypes"]
path = include/comtypes
url = https://github.com/nvaccess/comtypes-bin
[submodule "include/scons"]
path = include/scons
url = https://github.com/SCons/scons
[submodule "include/ia2"]
path = include/ia2
url = https://github.com/LinuxA11y/IAccessible2.git
[submodule "include/wxPython"]
path = include/wxPython
url = https://github.com/nvaccess/wxPython-bin.git
[submodule "include/configobj"]
path = include/configobj
url = https://github.com/DiffSK/configobj.git
[submodule "include/py2exe"]
path = include/py2exe
url = https://github.com/nvaccess/py2exe-bin
[submodule "include/javaAccessBridge32"]
path = include/javaAccessBridge32
url = https://github.com/nvaccess/javaAccessBridge32-bin.git
Expand Down
53 changes: 30 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ branches:
- master
- beta
- rc
- py3.8
- /try-.*/
# For tags, branch = tag if GitHub couldn't work out the base branch.
- /release-.*/

environment:
PY_PYTHON: 3.7-32
PY_PYTHON: 3.8-32
encFileKey:
secure: ekOvuyywHuDdGZmRmoj+b3jfrq39A2xlx4RD5ZUGd/8=
mozillaSymsAuthToken:
Expand Down Expand Up @@ -59,6 +60,14 @@ init:
clone_depth: 1

install:
# Activate the NvDA build system Python virtual environment, creating / updating it if necessary.
- .\venvUtils\ensureAndActivate.bat
- if ERRORLEVEL 1 exit %ERRORLEVEL%
# Save an exact list of the actual Python packages and their versions that got installed, to aide in reproducing a build
- py -m pip freeze >installed_python_packages.txt
- if ERRORLEVEL 1 exit %ERRORLEVEL%
- appveyor PushArtifact installed_python_packages.txt
- if ERRORLEVEL 1 exit %ERRORLEVEL%
- cd appveyor
# Decrypt files.
- ps: |
Expand Down Expand Up @@ -95,12 +104,15 @@ build_script:
Set-AppveyorBuildVariable "sconsOutTargets" $sconsOutTargets
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs
- 'echo scons args: %sconsArgs%'
- py scons.py source %sconsArgs%
- scons source %sconsArgs%
- if ERRORLEVEL 1 exit %ERRORLEVEL%
# We don't need launcher to run checkPot, so run the checkPot before launcher.
- py scons.py checkPot %sconsArgs%
- scons checkPot %sconsArgs%
Comment thread
feerrenrut marked this conversation as resolved.
Resolved
- if ERRORLEVEL 1 exit %ERRORLEVEL%
# The pot gets built by tests, but we don't actually need it as a build artifact.
- 'echo scons output targets: %sconsOutTargets%'
- py scons.py %sconsOutTargets% %sconsArgs%
- scons %sconsOutTargets% %sconsArgs%
- if ERRORLEVEL 1 exit %ERRORLEVEL%
# Build symbol store.
- ps: |
foreach ($syms in
Expand All @@ -115,12 +127,10 @@ build_script:
}
- cd symbols
- 7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
- if ERRORLEVEL 1 exit %ERRORLEVEL%
- cd ..

before_test:
# install required packages
- py -m pip install --upgrade pip
- py -m pip install -r tests/system/requirements.txt -r tests/lint/lintInstall/requirements.txt
- mkdir testOutput
- mkdir testOutput\unit
- mkdir testOutput\system
Expand Down Expand Up @@ -153,7 +163,7 @@ test_script:
$errorCode=0
$outDir = (Resolve-Path .\testOutput\unit\)
$unitTestsXml = "$outDir\unitTests.xml"
py -m nose -sv --with-xunit --xunit-file="$unitTestsXml" ./tests/unit
.\rununittests.bat --with-xunit --xunit-file="$unitTestsXml"
if($LastExitCode -ne 0) {
$errorCode=$LastExitCode
Add-AppveyorMessage "Unit test failure"
Expand All @@ -168,12 +178,14 @@ test_script:
if($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$lintOutput = (Resolve-Path .\testOutput\lint\)
$lintSource = (Resolve-Path .\tests\lint\)
git fetch -q origin $env:APPVEYOR_REPO_BRANCH
$prDiff = "$lintOutput\prDiff.patch"
git diff -U0 FETCH_HEAD...HEAD > $prDiff
$flake8Config = "$lintSource\flake8.ini"
$flake8Output = "$lintOutput\PR-Flake8.txt"
type "$prDiff" | py -Xutf8 -m flake8 --diff --output-file="$flake8Output" --tee --config="$flake8Config"
# When Appveyor runs for a pr,
# the build is made from a new temporary commit,
# resulting from the pr branch being merged into its base branch.
# Therefore to create a diff for linting, we must fetch the head of the base branch.
# In a PR, APPVEYOR_REPO_BRANCH points to the head of the base branch.
git fetch -q origin $env:APPVEYOR_REPO_BRANCH
$flake8Output = "$lintOutput\PR-Flake8.txt"
.\runlint.bat FETCH_HEAD "$flake8Output"
if($LastExitCode -ne 0) {
$errorCode=$LastExitCode
Add-AppveyorMessage "PR introduces Flake8 errors"
Expand All @@ -191,19 +203,14 @@ test_script:
- ps: |
$testOutput = (Resolve-Path .\testOutput\)
$systemTestOutput = (Resolve-Path "$testOutput\system")
$testSource = ".\tests\system\robot"

$robotArgs = '--argumentfile', '.\tests\system\robotArgs.robot'
# useInstalledNVDA must come after args file to override the whichNVDA value
$useInstalledNVDA = '--variable', 'whichNVDA:installed'

py -m robot $robotArgs $useInstalledNVDA $testSource
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"

.\runsystemtests.bat --variable whichNVDA:installed
if($LastExitCode -ne 0) {
$errorCode=$LastExitCode
Add-AppveyorMessage "System test failure"
}
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$systemTestOutput\systemTests.xml"))
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }
Expand Down
24 changes: 24 additions & 0 deletions devDocs/buildSystemNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
A Python virtual environment is used transparently by the NVDA build system, and all Python dependencies are installed into this environment using `pip`.

NVDA's build system commands will handle all aspects of the virtual environment.
Developers should not create or activate the virtual environment manually, unless working on the build system itself.

* To build NVDA, SCons should continue to be used in the usual way. E.g. executing scons.bat in the root of the repository. Running `py -m SCons` is no longer supported, and scons.py has also been removed.
Comment thread
feerrenrut marked this conversation as resolved.
Resolved
* To run NVDA from source, rather than executing `source/nvda.pyw` directly, the developer should now use `runnvda.bat` in the root of the repository. `runnvda.bat` uses `pythonw.exe` internally to execute NVDA. If you do try to execute `source/nvda.pyw`, a message box will alert you this is no longer supported.
* To perform unit tests, execute `rununittests.bat [<extra unittest discover options>]`
* To perform system tests: execute `runsystemtests.bat [<extra robot options>]`
* To perform linting, execute `runlint.bat <base branch>`

Behind the scenes, the above batch files (`scons`, `runnvda`, `rununittests`, `runsystemtests` and `runlint`) ensure that the Python virtual environment is created and up to date, activates the environment, runs the command and then deactivates. All transparently. A developer should not have to know about the Python virtual environment at all.
The first time one of these commands are run, the virtual environment will be created, and all required Python dependencies will be installed with `pip`. You can see the entire list of packages and their exact versions that `pip` will use, in `requirements.txt` in the root of the repository.

`venvUtils/ensureVenv.py` contains the logic to check for, create and update the virtual environment.
If a previous virtual environment exists but has a miss-matching Python version or pip package requirements have changed, The virtual environment is recreated with the updated version of Python and packages.
If a virtual environment is found but does not seem to be ours, the user is asked if it should be overwritten or not.
This script also detects if it is being run from an existing 3rd party Python virtual environment and aborts if so. thus, it is impossible to execute SCons or NVDA from source within another Python virtual environment.

`venvUtils/ensureAndActivate.bat` can be used to ensure the virtual environment exists and is up to date, and then activates it in the current shell, ready for other commands to be executed in the context of NVDA's build system Python virtual environment. this would never normally be executed by itself, though appVeyor uses it at the beginning of its execution and leaves the environment active for the remainder of its execution.

`venvUtils/venvCmd.bat` is a script that runs a single command within the context of the NVDA build system Python virtual environment. It ensures and activates the environment, executes the command, and then deactivates the environment. this script is what all the high-level batch files use internally.

SConstruct, and `source/nvda.pyw` both contain logic that detects the NVDA build system Python virtual environment, and abort if it is not active.
1 change: 0 additions & 1 deletion devDocs/devDocsInstall/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions devDocs/devDocsInstall/requirements.txt

This file was deleted.

35 changes: 0 additions & 35 deletions devDocs/devDocsInstall/sconscript

This file was deleted.

5 changes: 0 additions & 5 deletions devDocs/sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ Import("env", "outputDir", "sourceDir", "t2tBuildConf")

env = env.Clone()

devDocsInstall = env.SConscript("devDocsInstall/sconscript", exports=["env"])
env.Depends(devDocsInstall, env.Dir("devDocs/devDocsInstall/requirements.txt"))
env.Alias("devDocsInstall", devDocsInstall)

devDocsOutputDir=outputDir.Dir('devDocs')

#Build the developer guide and move it to the output directory
Expand Down Expand Up @@ -69,7 +65,6 @@ sphinxAPIDocs = env.Command(
] + [f"{sourceDir}\\{f}" for f in ignorePaths]
]
)
env.Depends(sphinxAPIDocs, devDocsInstall)
sphinxHtml = env.Command(
"_build",
sphinxAPIDocs,
Expand Down
1 change: 0 additions & 1 deletion include/comtypes
Submodule comtypes deleted from 8c4558
1 change: 0 additions & 1 deletion include/configobj
Submodule configobj deleted from f9a265
2 changes: 1 addition & 1 deletion include/nvda_dmp
1 change: 0 additions & 1 deletion include/py2exe
Submodule py2exe deleted from c496ae
1 change: 0 additions & 1 deletion include/pyserial
Submodule pyserial deleted from c54c81
1 change: 0 additions & 1 deletion include/scons
Submodule scons deleted from dfcc78
1 change: 0 additions & 1 deletion include/wxPython
Submodule wxPython deleted from 11de93
2 changes: 0 additions & 2 deletions nvdaHelper/espeak/sconscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from include.scons.SCons.Util import CLVar

Import([
'thirdPartyEnv',
'sourceDir',
Expand Down
4 changes: 2 additions & 2 deletions nvdaHelper/liblouis/sconscript
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import re
import glob
from SCons.Tool.MSCommon.vc import find_vc_pdir
import typing
from include.scons.SCons.Environment import Environment
from include.scons.SCons.Environment import Base
from SCons.Environment import Environment
from SCons.Environment import Base

Import([
"thirdPartyEnv",
Expand Down
Loading