Skip to content

Commit 697bf9f

Browse files
authored
Merge 3eef81c into 12b96a2
2 parents 12b96a2 + 3eef81c commit 697bf9f

105 files changed

Lines changed: 3497 additions & 1050 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
[submodule "include/w3c-aria-practices"]
2525
path = include/w3c-aria-practices
2626
url = https://github.com/w3c/aria-practices
27-
[submodule "include/cldr"]
28-
path = include/cldr
29-
url = https://github.com/unicode-org/cldr-staging.git
3027
[submodule "include/Detours"]
3128
path = include/detours
3229
url = https://github.com/microsoft/Detours/
@@ -39,3 +36,8 @@
3936
[submodule "include/wil"]
4037
path = include/wil
4138
url = https://github.com/microsoft/wil
39+
[submodule "nvda-cldr"]
40+
path = include/nvda-cldr
41+
url = https://github.com/nvaccess/nvda-cldr.git
42+
branch = main-out
43+
shallow = true

appveyor.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Build configuration for Appveyor
2+
# Many more options available, see docs:
3+
# https://www.appveyor.com/docs/appveyor-yml/
4+
15
os: Visual Studio 2019
26
version: "{branch}-{build}"
37

@@ -8,7 +12,13 @@ branches:
812
- rc
913
- /try-.*/
1014
- /release-.*/
11-
15+
16+
# scripts that are called at very beginning, before repo cloning
17+
init:
18+
# set the init time for the build, used to calculate the time taken for each stage of the build.
19+
- ps: |
20+
"INIT, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
21+
1222
environment:
1323
PY_PYTHON: 3.7-32
1424
secure_authenticode_pass:
@@ -20,12 +30,18 @@ environment:
2030
symstore: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe
2131

2232
install:
33+
- ps: |
34+
"INSTALL_START, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
2335
- ps: appveyor\scripts\setBuildVersionVars.ps1
2436
- ps: appveyor\scripts\decryptFilesForSigning.ps1
2537
- py -m pip install --upgrade --no-warn-script-location pip
2638
- git submodule update --init
39+
- ps: |
40+
"INSTALL_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
2741
2842
build_script:
43+
- ps: |
44+
"BUILD_START, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
2945
- ps: appveyor\scripts\setSconsArgs.ps1
3046
- scons source %sconsArgs%
3147
- scons %sconsOutTargets% %sconsArgs%
@@ -35,16 +51,26 @@ build_script:
3551
- cd symbols
3652
- 7z a -tzip -r ..\output\symbols.zip *.dl_ *.ex_ *.pd_
3753
- cd ..
54+
- ps: |
55+
"BUILD_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
3856
3957
before_test:
58+
- ps: |
59+
"TESTSETUP_START, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
4060
- ps: appveyor\scripts\tests\beforeTests.ps1
4161
- ps: appveyor\scripts\installNVDA.ps1
62+
- ps: |
63+
"TESTSETUP_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
4264
4365
test_script:
66+
- ps: |
67+
"TEST_START, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
4468
- ps: appveyor\scripts\tests\translationCheck.ps1
4569
- ps: appveyor\scripts\tests\unitTests.ps1
4670
- ps: appveyor\scripts\tests\lintCheck.ps1
4771
- ps: appveyor\scripts\tests\systemTests.ps1
72+
- ps: |
73+
"TEST_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
4874
4975
after_test:
5076
- ps: appveyor\scripts\tests\checkTestFailure.ps1
@@ -61,3 +87,6 @@ on_failure:
6187

6288
on_finish:
6389
- ps: appveyor\scripts\pushPackagingInfo.ps1
90+
- ps: |
91+
"FINISH_END, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append
92+
- ps: appveyor\scripts\logCiTiming.ps1

appveyor/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,23 @@ At the end of the build, regardless of failure, we upload the list of successful
5757
## Deploying
5858

5959
The server side deploy code (`nvdaAppveyorHook`) is triggered from `deployScript.ps1`. The server-side deployment relies on our artifacts, so they must be uploaded first.
60+
61+
62+
## Modifying behavior
63+
64+
Environment variables can be configured to modify behavior on Appveyor.
65+
These tools can be used (by NV Access) to more quickly investigate issues with the build.
66+
These must be set before the build starts, and should be removed again once the build has started.
67+
68+
- `APPVEYOR_RDP_PASSWORD`: Setting an RDP password will allow connecting over RDP.
69+
Monitor the early build output to get the connection string.
70+
- `VERBOSE_SYSTEM_TEST_LOGGING`: Setting `True` (or any non-empty string) will enable more verbose NVDA logs
71+
for the tests.
72+
See method `enable_verbose_debug_logging_if_requested` in `NvdaLib.py`, enables:
73+
- `MSAA`
74+
- `UIA`
75+
- `TimeSinceInput`
76+
- `INCLUDE_SYSTEM_TEST_TAGS`: Set (space separated) tags to be used when running system tests.
77+
- E.G. To run the tests with the default tags: `installer NVDA`
78+
- See the `*.robot` files for tags.
79+
- Use `excluded_from_build` to run no system tests.

appveyor/scripts/logCiTiming.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Input: ../timing.csv
2+
# Expect two cols:
3+
# - Build-stage name
4+
# - Time [Get-Date -o] (Round trip format)
5+
# Process: add elapsed minutes between entries
6+
# Output:
7+
# - buildStageTimingWithElapsed.csv
8+
# - CI Timing message to Appveyor messages.
9+
$inputFile = "../timing.csv"
10+
$processedTimesFile = "buildStageTimingWithElapsed.csv"
11+
12+
$entries = Import-Csv -Path $inputFile -Header Stage, Time
13+
$lastTime = Get-Date -Date $entries[0].Time
14+
15+
foreach ($e in $entries) {
16+
$nextTime = Get-Date -Date $e.Time
17+
$elapsedMin = ($nextTime - $lastTime).TotalMinutes
18+
$e | Add-Member -NotePropertyName ElapsedMin -NotePropertyValue $elapsedMin
19+
$lastTime = $nextTime
20+
}
21+
22+
$entries | Export-Csv -Path $processedTimesFile
23+
24+
$mesgs = (
25+
$entries.foreach({
26+
($_.Stage, $_.ElapsedMin.tostring('N1')) -join " "
27+
})
28+
) -join ", `n"
29+
30+
Add-AppveyorMessage ("CI timing (mins): `n" + $mesgs)
31+
32+
if (Test-Path -Path $processedTimesFile){
33+
Push-AppveyorArtifact $processedTimesFile -FileName $processedTimesFile
34+
}

appveyor/scripts/tests/systemTests.ps1

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
11
$testOutput = (Resolve-Path .\testOutput\)
22
$systemTestOutput = (Resolve-Path "$testOutput\system")
33

4+
if ($env:VERBOSE_SYSTEM_TEST_LOGGING) {
5+
$verboseDebugLogging="True"
6+
} else {
7+
$verboseDebugLogging=""
8+
}
9+
10+
# This tag is used to exclude system tests.
11+
# If provided to runsystemtests, RF would give an error.
12+
$SKIP_SYS_TESTS = "excluded_from_build"
13+
$tagsForTest = "installer NVDA" # include the tests tagged with installer, or NVDA
14+
if ($env:INCLUDE_SYSTEM_TEST_TAGS) {
15+
if ($env:INCLUDE_SYSTEM_TEST_TAGS -eq $SKIP_SYS_TESTS) {
16+
# Indicate the tests were skipped, and exit early.
17+
Add-AppveyorMessage "Skipped: System tests."
18+
return
19+
}
20+
$tagsForTest = $env:INCLUDE_SYSTEM_TEST_TAGS
21+
22+
}
23+
$tagsForTestArray = -split $tagsForTest # turn this string into an array
24+
$includeTags = $tagsForTestArray | ForEach-Object {
25+
# Before every item output '--include'
26+
# No spaces required.
27+
# Including spaces will result in automatic quote characters around the string. I.E. "--include "
28+
"--include", $_
29+
}
30+
431
.\runsystemtests.bat `
532
--variable whichNVDA:installed `
633
--variable installDir:"${env:nvdaLauncherFile}" `
7-
--include installer `
8-
--include NVDA `
34+
--variable verboseDebugLogging:"${verboseDebugLogging}" `
35+
@includeTags `
936
# last line inentionally blank, allowing all lines to have line continuations.
1037

1138
if($LastExitCode -ne 0) {
1239
Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode
13-
Add-AppveyorMessage "FAIL: System tests. See test results for more information."
40+
Add-AppveyorMessage "FAIL: System tests (tags: ${tagsForTest}). See test results for more information."
1441
} else {
15-
Add-AppveyorMessage "PASS: System tests."
42+
Add-AppveyorMessage "PASS: System tests (tags: ${tagsForTest})."
1643
}
1744
Compress-Archive -Path "$systemTestOutput\*" -DestinationPath "$testOutput\systemTestResult.zip"
1845
Push-AppveyorArtifact "$testOutput\systemTestResult.zip"

appx/manifest.xml.subst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<TargetDeviceFamily
2525
Name="Windows.Desktop"
2626
MinVersion="10.0.18990.0"
27-
MaxVersionTested="10.0.19044.0"
27+
MaxVersionTested="10.0.22621.0"
2828
/>
2929
</Dependencies>
3030
<Capabilities>

cldrDict_sconscript

Lines changed: 22 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,28 @@
1-
###
2-
#This file is a part of the NVDA project.
3-
#URL: http://www.nvda-project.org/
4-
#Copyright 2018 NV Access Limited, Babbage B.V.
5-
#This program is free software: you can redistribute it and/or modify
6-
#it under the terms of the GNU General Public License version 2.0, as published by
7-
#the Free Software Foundation.
8-
#This program is distributed in the hope that it will be useful,
9-
#but WITHOUT ANY WARRANTY; without even the implied warranty of
10-
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11-
#This license can be found at:
12-
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13-
###
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2018-2022 NV Access Limited
3+
# This file may be used under the terms of the GNU General Public License, version 2 or later.
4+
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
145

15-
Import(
16-
'env', 'sourceDir',
17-
)
186

19-
def createCLDRAnnotationsDict(sources, dest):
20-
import codecs
21-
from xml.etree import ElementTree
22-
from collections import OrderedDict
23-
cldrDict = OrderedDict()
24-
for source in sources:
25-
tree = ElementTree.parse(source)
26-
for element in tree.iter("annotation"):
27-
if element.attrib.get("type") == "tts":
28-
cldrDict[element.attrib['cp']] = element.text.replace(":","")
29-
assert cldrDict, "cldrDict is empty"
30-
with codecs.open(dest, "w", "utf_8_sig", errors="replace") as dictFile:
31-
dictFile.write(u"symbols:\r\n")
32-
for pattern, description in cldrDict.items():
33-
# Punctuations are set to none for CLDR characters to be pronounced even if user set punctuation level to None
34-
dictFile.write(u"{pattern}\t{description}\tnone\r\n".format(
35-
pattern=pattern,
36-
description=description
37-
))
7+
import typing
8+
if typing.TYPE_CHECKING:
9+
import SCons
10+
from SCons import(
11+
Dir,
12+
Import,
13+
)
3814

39-
cldrDictAction=env.Action(
40-
lambda target,source,env: createCLDRAnnotationsDict([src.path for src in source], target[0].path),
41-
lambda target,source,env: 'Generating %s'%target[0],
42-
)
43-
cldrDictBuilder=env.Builder(
44-
action=cldrDictAction,
45-
suffix='.dic',
46-
src_suffix='.xml',
15+
sourceDir: "SCons.Node.FS.Dir"
16+
env: "SCons.Environment.Base"
17+
Import(
18+
'env',
19+
'sourceDir',
4720
)
48-
env['BUILDERS']['cldrDict']=cldrDictBuilder
4921

50-
NVDAToCLDRLocales = {
51-
"af_ZA":("af",),
52-
"am":("am",),
53-
#"an":(),
54-
"ar":("ar",),
55-
"as":("as",),
56-
"bg":("bg",),
57-
"bn":("bn",),
58-
"ca":("ca",),
59-
"ckb":("ckb",),
60-
"cs":("cs",),
61-
"da":("da",),
62-
"de":("de",),
63-
"de_CH":("de_CH",),
64-
"el":("el",),
65-
"en":("en_001","en"),
66-
"es":("es",),
67-
"es_CO":("es_419",),
68-
"fa":("fa",),
69-
"fi":("fi",),
70-
"fr":("fr",),
71-
"ga":("ga",),
72-
"gl":("gl",),
73-
"gu":("gu",),
74-
"he":("he",),
75-
"hi":("hi",),
76-
"hr":("hr",),
77-
"hu":("hu",),
78-
"id":("id",),
79-
"is":("is",),
80-
"it":("it",),
81-
"ja":("ja",),
82-
"ka":("ka",),
83-
#"kmr":(),
84-
"kn":("kn",),
85-
"ko":("ko",),
86-
"kok":("kok",),
87-
"ky":("ky",),
88-
"lt":("lt",),
89-
"mk":("mk",),
90-
"ml":("ml",),
91-
"mn":("mn",),
92-
"mni":("mni",),
93-
"my":("my",),
94-
"nb_NO":("no",),
95-
"ne":("ne",),
96-
"nl":("nl",),
97-
"nn_NO":("nn",),
98-
"pa":("pa",),
99-
"pl":("pl",),
100-
"pt_BR":("pt",),
101-
"pt_pt":("pt","pt_PT"),
102-
"ro":("ro",),
103-
"ru":("ru",),
104-
"sk":("sk",),
105-
"sl":("sl",),
106-
"so":("so",),
107-
"sq":("sq",),
108-
"sr":("sr",),
109-
"sv":("sv",),
110-
"ta":("ta",),
111-
"te":("te",),
112-
"th":("th",),
113-
"tr":("tr",),
114-
"uk":("uk",),
115-
"ur":("ur",),
116-
"vi":("vi",),
117-
"zh_cn":("zh",),
118-
"zh_hk":("zh","zh_Hant_HK"),
119-
"zh_tw":("zh","zh_Hant"),
120-
}
22+
targetCldrDir = sourceDir.Dir('locale')
23+
cldrDataSource = Dir("include/nvda-cldr/locale")
12124

122-
annotationsDir = env.Dir("include/cldr/production/common/annotations")
123-
annotationsDerivedDir = env.Dir("include/cldr/production/common/annotationsDerived")
124-
for destLocale, sourceLocales in NVDAToCLDRLocales.items():
125-
cldrSources = []
126-
# First add all annotations, then the derived ones.
127-
for sourceLocale in sourceLocales:
128-
cldrSources.append(annotationsDir.File("%s.xml" % sourceLocale))
129-
for sourceLocale in sourceLocales:
130-
cldrSources.append(annotationsDerivedDir.File("%s.xml" % sourceLocale))
131-
env.cldrDict(sourceDir.Dir("locale/%s" % destLocale).File("cldr.dic"), cldrSources)
25+
env.RecursiveInstall(
26+
targetCldrDir,
27+
cldrDataSource.abspath
28+
)

devDocs/codingStandards.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,14 @@ self.copySettingsButton = wx.Button(
102102
* Unused imports will give a lint warning. These can be handled the following ways:
103103
- If these imports are inteded to be imported from other modules, they can be done included in a definition for `__all__`. This will override and define the symbols imported when performing a star import, eg `from module import *`.
104104
- Otherwise, with a comment like `# noqa: <explanation>`.
105+
106+
### Considering future backwards compatibility
107+
108+
When writing new code, consider how the code can be moved in future while retaining backwards compatibility.
109+
Refer to the [limitations to retaining backwards compatibility](./deprecations.md#limitations-to-retaining-backwards-compatibility).
110+
111+
In summary:
112+
- Avoid module level global variables.
113+
Any module level variables should be prefixed with and underscore and be encapsulated, e.g. via getters and setters.
114+
- Avoid code which executes at import time.
115+
Instead use initializer functions.

0 commit comments

Comments
 (0)