diff --git a/appveyor.yml b/appveyor.yml index 4406523d9fd..47a8ac24506 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ init: "INIT, $(Get-Date -Format 'o')"| Out-File ../timing.csv -Append environment: - PY_PYTHON: 3.7-32 + PY_PYTHON: 3.11-32 secure_authenticode_pass: secure: Way+hJyhbiLG/cmCo4+dHHzS5DiSvk/45o6frnIQ27GBX6nVDsh7jwQ7fSnqxBRP secure_ssh_pass: diff --git a/appveyor/scripts/tests/unitTests.ps1 b/appveyor/scripts/tests/unitTests.ps1 index b08d366ef2c..75483a8f279 100644 --- a/appveyor/scripts/tests/unitTests.ps1 +++ b/appveyor/scripts/tests/unitTests.ps1 @@ -1,6 +1,6 @@ $outDir = (Resolve-Path .\testOutput\unit\) $unitTestsXml = "$outDir\unitTests.xml" -.\rununittests.bat --with-xunit --xunit-file="$unitTestsXml" +.\rununittests.bat --output-file "$unitTestsXml" if($LastExitCode -ne 0) { Set-AppveyorBuildVariable "testFailExitCode" $LastExitCode Add-AppveyorMessage "FAIL: Unit tests. See test results for more information." diff --git a/appx/sconscript b/appx/sconscript index d4ae2e8efd9..ce2cf64b78a 100644 --- a/appx/sconscript +++ b/appx/sconscript @@ -61,8 +61,7 @@ else: # not for submission, just side-loadable signExec=env['signExec'] if env['certFile'] else None # Files from NVDA's distribution that cannot be included in the appx due to policy or security restrictions -excludedDistFiles=[ - 'nvda_eoaProxy.exe', +excludedDistFiles = [ 'nvda_service.exe', 'nvda_slave.exe', 'nvda_noUIAccess.exe', @@ -107,4 +106,3 @@ if signExec and not isStoreSubmission: env.AddPostAction(appx,signExec) Return(['appx']) - diff --git a/nvdaHelper/archBuild_sconscript b/nvdaHelper/archBuild_sconscript index 8b55ccf550d..d81b4ae6fd2 100644 --- a/nvdaHelper/archBuild_sconscript +++ b/nvdaHelper/archBuild_sconscript @@ -1,16 +1,7 @@ -### -#This file is a part of the NVDA project. -#URL: http://www.nvda-project.org/ -#Copyright 2006-2010 NVDA contributers. -#This program is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License version 2.0, as published by -#the Free Software Foundation. -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#This license can be found at: -#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html -### +# A part of NonVisual Desktop Access (NVDA) +# Copyright (C) 2006-2023 NV Access Limited +# This file may be used under the terms of the GNU General Public License, version 2 or later. +# For more details see: https://www.gnu.org/licenses/gpl-2.0.html import os import shutil @@ -87,7 +78,7 @@ env.Append( 'UNICODE', '_CRT_SECURE_NO_DEPRECATE', ('LOGLEVEL', '${nvdaHelperLogLevel}'), - ('_WIN32_WINNT', '_WIN32_WINNT_WIN7'), + ('_WIN32_WINNT', '_WIN32_WINNT_WINBLUE'), # NOMINMAX: prevent minwindef.h min/max macro definition, which unexpectedly override developer # expectations 'NOMINMAX', @@ -102,10 +93,10 @@ env.Append(CPPPATH=[ '#/miscDeps/include', Dir('.').abspath ]) -if TARGET_ARCH == "arm64": - subsystem = "/subsystem:windows,6.02" -else: - subsystem = "/subsystem:windows,6.01" + +# Windows 8.1 (blue) +subsystem = "/subsystem:windows,6.03" + env.Append( LINKFLAGS=[ '/incremental:no', diff --git a/nvdaHelper/local/nvdaHelperLocal.cpp b/nvdaHelper/local/nvdaHelperLocal.cpp index 0b31716fca5..2e6b674146a 100644 --- a/nvdaHelper/local/nvdaHelperLocal.cpp +++ b/nvdaHelper/local/nvdaHelperLocal.cpp @@ -1,15 +1,8 @@ /* -This file is a part of the NVDA project. -URL: http://www.nvda-project.org/ -Copyright 2008-2014 NV Access Limited. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2.0, as published by - the Free Software Foundation. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -This license can be found at: -http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +A part of NonVisual Desktop Access (NVDA) +Copyright (C) 2008-2023 NV Access Limited +This file may be used under the terms of the GNU General Public License, version 2 or later. +For more details see: https://www.gnu.org/licenses/gpl-2.0.html */ #include @@ -28,20 +21,6 @@ decltype(&SendMessageW) real_SendMessageW = nullptr; decltype(&SendMessageTimeoutW) real_SendMessageTimeoutW = nullptr; decltype(&OpenClipboard) real_OpenClipboard = nullptr; -typedef struct _RPC_SECURITY_QOS_V5_W { - unsigned long Version; - unsigned long Capabilities; - unsigned long IdentityTracking; - unsigned long ImpersonationType; - unsigned long AdditionalSecurityInfoType; - union - { - RPC_HTTP_TRANSPORT_CREDENTIALS_W *HttpCredentials; - } u; - void *Sid; - unsigned int EffectiveOnly; - void *ServerSecurityDescriptor; -} RPC_SECURITY_QOS_V5_W, *PRPC_SECURITY_QOS_V5_W; handle_t createRemoteBindingHandle(wchar_t* uuidString) { RPC_STATUS rpcStatus; diff --git a/nvdaHelper/readme.md b/nvdaHelper/readme.md index b7121ccf3f5..4d6ca74e253 100644 --- a/nvdaHelper/readme.md +++ b/nvdaHelper/readme.md @@ -70,7 +70,7 @@ You should still build on the command line to verify errors. - Press next - Specify Debug Configuration Settings - Build command line: `scons source` - - Preprocessor definitions (/D): `WIN32;_WINDOWS;_USRDLL;NVDAHELPER_EXPORTS;UNICODE;_CRT_SECURE_NO_DEPRECATE;LOGLEVEL=15;_WIN32_WINNT=_WIN32_WINNT_WIN7;NOMINMAX` + - Preprocessor definitions (/D): `WIN32;_WINDOWS;_USRDLL;NVDAHELPER_EXPORTS;UNICODE;_CRT_SECURE_NO_DEPRECATE;LOGLEVEL=15;_WIN32_WINNT=_WIN32_WINNT_WINBLUE;NOMINMAX` - Include search paths (/I): `../include;../miscDeps/include;./;../build\x86_64;../include/minhook/include` - Forced Included files (/FI): `winuser.h` - Press next @@ -90,7 +90,7 @@ You should still build on the command line to verify errors. ``` cl /Fobuild\x86\vbufBackends\gecko_ia2\gecko_ia2.obj /c build\x86\vbufBackends\gecko_ia2\gecko_ia2.cpp /TP /EHsc /nologo /std:c++20 /permissive- /Od /MT /W3 /WX - /DUNICODE /D_CRT_SECURE_NO_DEPRECATE /DLOGLEVEL=15 /D_WIN32_WINNT=_WIN32_WINNT_WIN7 /DNOMINMAX /DNDEBUG + /DUNICODE /D_CRT_SECURE_NO_DEPRECATE /DLOGLEVEL=15 /D_WIN32_WINNT=_WIN32_WINNT_WINBLUE /DNOMINMAX /DNDEBUG /Iinclude /Imiscdeps\include /Ibuild\x86 /Z7 ``` diff --git a/projectDocs/dev/createDevEnvironment.md b/projectDocs/dev/createDevEnvironment.md index 940305e042b..ecf3c633720 100644 --- a/projectDocs/dev/createDevEnvironment.md +++ b/projectDocs/dev/createDevEnvironment.md @@ -34,7 +34,7 @@ The NVDA source depends on several other packages to run correctly. ### Installed Dependencies The following dependencies need to be installed on your system: -* [Python](https://www.python.org/), version 3.7, 32 bit +* [Python](https://www.python.org/), version 3.11, 32 bit * Use latest minor version if possible. * Microsoft Visual Studio 2019 or 2022: * To replicate the production build environment, use the [version of Visual Studio 2019 that AppVeyor is using](https://www.appveyor.com/docs/windows-images-software/#visual-studio-2019). diff --git a/requirements.txt b/requirements.txt index b84d871f30c..4e0e409be19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,37 +4,30 @@ SCons==4.5.2 # NVDA's runtime dependencies comtypes==1.2.0 pyserial==3.5 -wxPython==4.1.1 -git+https://github.com/DiffSK/configobj@3e2f4cc#egg=configobj +wxPython==4.2.1 +git+https://github.com/DiffSK/configobj@e2ba4457c4651fa54f8d59d8dcdd3da950e956b8#egg=configobj requests==2.31.0 -# Required to use a pinned old version for requests. -# py2exe fails to compile properly without this. -# This can be removed when upgrading py2exe to 0.13+ and python to 3.8+. -# https://github.com/Ousret/charset_normalizer/issues/253 -charset-normalizer==2.1.1 +# Pillow is an implicit dependency and requires zlib and jpeg by default, but we don't need it +Pillow==10.0.1 -C "zlib=disable" -C "jpeg=disable" #NVDA_DMP requires diff-match-patch fast_diff_match_patch==2.0.1 # Packaging NVDA -py2exe==0.11.1.0 +git+https://github.com/py2exe/py2exe@4e7b2b2c60face592e67cb1bc935172a20fa371d#egg=py2exe -# For building developer documentation -sphinx==5.1.1 -sphinx_rtd_theme==1.0.0 +# Creating XML unit test reports +unittest-xml-reporting==3.2.0 -# Requirements for type checking. -# typing_extensions is incorporated in py3.8+, also available via mypy -typing_extensions==4.3.0 +# For building developer documentation +sphinx==7.2.6 +sphinx_rtd_theme==1.3.0 # Requirements for automated linting flake8 ~= 3.7.7 flake8-tabs == 2.1.0 -# Requirements for unit tests -nose==1.3.7 - # Requirements for system tests -robotframework==3.2.2 -robotremoteserver==1.1 -robotframework-screencaplibrary==1.5.0 +robotframework==6.1.1 +robotremoteserver==1.1.1 +robotframework-screencaplibrary==1.6.0 diff --git a/rununittests.bat b/rununittests.bat index 49d96d78a16..f2782d0e696 100644 --- a/rununittests.bat +++ b/rununittests.bat @@ -4,5 +4,7 @@ set here=%hereOrig% if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% set scriptsDir=%here%\venvUtils set unitTestsPath=%here%\tests\unit +set testOutput=%here%\testOutput\unit +md %testOutput% -call "%scriptsDir%\venvCmd.bat" py -m nose -sv --traverse-namespace -w "%unitTestsPath%" %* +call "%scriptsDir%\venvCmd.bat" py -m xmlrunner discover -v -s "%unitTestsPath%" -t "%here%" --output-file "%testOutput%\unitTests.xml" %* diff --git a/sconstruct b/sconstruct index 8eaaeb2d884..ee7c5b12ae2 100755 --- a/sconstruct +++ b/sconstruct @@ -23,8 +23,8 @@ if nvdaVenv != virtualEnv: print("Warning: SCons launched within a custom Python virtual environment.") # Variables for storing required version of Python, and the version which is used to run this script. -requiredPythonMajor ="3" -requiredPythonMinor = "7" +requiredPythonMajor = "3" +requiredPythonMinor = "11" requiredPythonArchitecture = "32bit" installedPythonMajor = str(sys.version_info.major) installedPythonMinor = str(sys.version_info.minor) @@ -308,16 +308,12 @@ def NVDADistGenerator(target, source, env, for_signature): # which scons treats as an error code. and None] - buildCmd = ["cd", source[0].path, "&&", - sys.executable] + buildCmd = ["cd", source[0].path, "&&", sys.executable] if release: buildCmd.append("-O") # Issue errors about str(bytes_instance), str(bytearray_instance) buildCmd.append("-bb") - buildCmd.extend(("setup.py", "-vv", "build", "--build-base", buildDir.abspath, - "py2exe", "--dist-dir", target[0].abspath)) - if release: - buildCmd.append("-O1") + buildCmd.append("setup.py") if env.get("uiAccess"): buildCmd.append("--enable-uiAccess") @@ -346,7 +342,7 @@ def NVDADistGenerator(target, source, env, for_signature): action.append(Copy(target[0], file.path)) if certFile: - for prog in "nvda_noUIAccess.exe", "nvda_uiAccess.exe", "nvda_slave.exe", "nvda_eoaProxy.exe": + for prog in "nvda_noUIAccess.exe", "nvda_uiAccess.exe", "nvda_slave.exe": action.append(lambda target,source,env, progByVal=prog: signExec([target[0].File(progByVal)],source,env)) action.extend(( diff --git a/source/UIAHandler/types.py b/source/UIAHandler/types.py index 3b1ee6667fd..5b5a25f1025 100644 --- a/source/UIAHandler/types.py +++ b/source/UIAHandler/types.py @@ -5,8 +5,6 @@ from typing import ( List, -) -from typing_extensions import ( Protocol, ) diff --git a/source/_addonStore/models/addon.py b/source/_addonStore/models/addon.py index 187e24115c5..8bf158e0051 100644 --- a/source/_addonStore/models/addon.py +++ b/source/_addonStore/models/addon.py @@ -17,10 +17,8 @@ Generator, List, Optional, - Union, -) -from typing_extensions import ( Protocol, + Union, ) from requests.structures import CaseInsensitiveDict diff --git a/source/_addonStore/models/status.py b/source/_addonStore/models/status.py index 6d33fc58ef8..39bb6839a3a 100644 --- a/source/_addonStore/models/status.py +++ b/source/_addonStore/models/status.py @@ -10,12 +10,10 @@ Dict, Optional, OrderedDict, + Protocol, Set, TYPE_CHECKING, ) -from typing_extensions import ( - Protocol, -) import globalVars from logHandler import log diff --git a/source/_addonStore/models/version.py b/source/_addonStore/models/version.py index 2d1716f2126..0cb0f862bfb 100644 --- a/source/_addonStore/models/version.py +++ b/source/_addonStore/models/version.py @@ -7,8 +7,8 @@ from typing import ( NamedTuple, Optional, + Protocol, ) -from typing_extensions import Protocol # Python 3.8 adds native support import addonAPIVersion diff --git a/source/config/aggregatedSection.py b/source/config/aggregatedSection.py index 999b6cbb514..d859fe6ce52 100644 --- a/source/config/aggregatedSection.py +++ b/source/config/aggregatedSection.py @@ -5,9 +5,9 @@ from typing import ( Dict, + Protocol, Union, ) -from typing_extensions import Protocol class _SupportsStrT(Protocol): diff --git a/source/config/featureFlagEnums.py b/source/config/featureFlagEnums.py index 00f344447cf..5c49f6d4f59 100644 --- a/source/config/featureFlagEnums.py +++ b/source/config/featureFlagEnums.py @@ -12,16 +12,13 @@ """ import enum import typing +from typing import Protocol from utils.displayString import ( DisplayStringEnum, _DisplayStringEnumMixin, ) -from typing_extensions import ( - Protocol, # Python 3.8 adds native support -) - class FeatureFlagEnumProtocol(Protocol): """ All feature flags are expected to have a "DEFAULT" value. diff --git a/source/globalVars.py b/source/globalVars.py index 432e04db678..b6a1ba34d88 100644 --- a/source/globalVars.py +++ b/source/globalVars.py @@ -26,9 +26,9 @@ from typing import ( TYPE_CHECKING, List, + Literal, Optional, ) -from typing_extensions import Literal if TYPE_CHECKING: import documentBase # noqa: F401 used for type checking only diff --git a/source/installer.py b/source/installer.py index f809bf2b3e8..d5f9acb764c 100644 --- a/source/installer.py +++ b/source/installer.py @@ -698,25 +698,45 @@ def registerEaseOfAccess(installDir): versionInfo.name) winreg.SetValueEx(appKey, "Description", None, winreg.REG_SZ, versionInfo.longName) - if easeOfAccess.canConfigTerminateOnDesktopSwitch: - winreg.SetValueEx(appKey, "Profile", None, winreg.REG_SZ, - '') - winreg.SetValueEx(appKey, "SimpleProfile", None, winreg.REG_SZ, - "screenreader") - winreg.SetValueEx(appKey, "ATExe", None, winreg.REG_SZ, - "nvda.exe") - winreg.SetValueEx(appKey, "StartExe", None, winreg.REG_SZ, - os.path.join(installDir, u"nvda.exe")) - winreg.SetValueEx(appKey, "StartParams", None, winreg.REG_SZ, - "--ease-of-access") - winreg.SetValueEx(appKey, "TerminateOnDesktopSwitch", None, - winreg.REG_DWORD, 0) - else: - # We don't want NVDA to appear in EoA because - # starting NVDA from there won't work in this case. - # We can do this by not setting Profile and SimpleProfile. - # NVDA can still change the EoA logon settings. - winreg.SetValueEx(appKey, "ATExe", None, winreg.REG_SZ, - "nvda_eoaProxy.exe") - winreg.SetValueEx(appKey, "StartExe", None, winreg.REG_SZ, - os.path.join(installDir, u"nvda_eoaProxy.exe")) + winreg.SetValueEx( + appKey, + "Profile", + None, + winreg.REG_SZ, + '' + ) + winreg.SetValueEx( + appKey, + "SimpleProfile", + None, + winreg.REG_SZ, + "screenreader" + ) + winreg.SetValueEx( + appKey, + "ATExe", + None, + winreg.REG_SZ, + "nvda.exe" + ) + winreg.SetValueEx( + appKey, + "StartExe", + None, + winreg.REG_SZ, + os.path.join(installDir, "nvda.exe") + ) + winreg.SetValueEx( + appKey, + "StartParams", + None, + winreg.REG_SZ, + "--ease-of-access" + ) + winreg.SetValueEx( + appKey, + "TerminateOnDesktopSwitch", + None, + winreg.REG_DWORD, + 0 + ) diff --git a/source/louisHelper.py b/source/louisHelper.py index 7a3bdc72631..45c7ac17be0 100644 --- a/source/louisHelper.py +++ b/source/louisHelper.py @@ -1,14 +1,18 @@ -# louisHelper.py # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. -# Copyright (C) 2018 NV Access Limited, Babbage B.V. +# Copyright (C) 2018-2023 NV Access Limited, Babbage B.V. """Helper module to ease communication to and from liblouis.""" -import louis -from logHandler import log import config +from logHandler import log +import globalVars +import os + +with os.add_dll_directory(globalVars.appDir): + import louis + LOUIS_TO_NVDA_LOG_LEVELS = { louis.LOG_ALL: log.DEBUG, diff --git a/source/manifest.template.xml b/source/manifest.template.xml index f7454562328..f73d8e5bd23 100644 --- a/source/manifest.template.xml +++ b/source/manifest.template.xml @@ -15,14 +15,6 @@ - - - - argparse.Namespace: + """ + Adds a command line option --enable-uiAccess to enable uiAccess for the main executable and EOA proxy + Allows py2exe to parse the rest of the arguments """ + partialParser = argparse.ArgumentParser() + partialParser.add_argument( + "--enable-uiAccess", + dest="uiAccess", + action="store_true", + help="enable uiAccess for the main executable", + default=False, + ) + partialArgs, _argslist = partialParser.parse_known_args(sys.argv) + return partialArgs + - user_options = distutils_buildexe.py2exe.user_options + [ - ("enable-uiAccess", "u", "enable uiAccess for the main executable"), - ] +_partialArgs = _parsePartialArguments() - def initialize_options(self): - super(py2exe, self).initialize_options() - self.enable_uiAccess = False - def run(self): - with open(manifestTemplateFilePath, "r", encoding="utf-8") as manifestTemplateFile: - manifestTemplate = manifestTemplateFile.read() - dist = self.distribution - if self.enable_uiAccess: - # Add a target for nvda_uiAccess, using nvda_noUIAccess as a base. - target = copy.deepcopy(dist.windows[0]) - target["dest_base"] = "nvda_uiAccess" - target['uiAccess'] = True - dist.windows.insert(1, target) - # nvda_eoaProxy should have uiAccess. - target = dist.windows[3] - target['uiAccess'] = True - # Add a manifest resource to every target at runtime. - for target in dist.windows: - target["other_resources"] = [ - ( - RT_MANIFEST, - 1, - (manifestTemplate % dict(uiAccess=target['uiAccess'])).encode("utf-8") - ), - ] - super(py2exe, self).run() +with open(manifestTemplateFilePath, "r", encoding="utf-8") as manifestTemplateFile: + _manifestTemplate = manifestTemplateFile.read() + def getLocaleDataFiles(): wxDir=wx.__path__[0] @@ -110,80 +92,92 @@ def getRecursiveDataFiles(dest,source,excludes=()): [rulesList.extend(getRecursiveDataFiles(os.path.join(dest,dirName),os.path.join(source,dirName),excludes=excludes)) for dirName in os.listdir(source) if os.path.isdir(os.path.join(source,dirName)) and not dirName.startswith('.')] return rulesList -setup( - name = name, - version=version, - description=description, - url=url, - classifiers=[ -'Development Status :: 3 - Alpha', -'Environment :: Win32 (MS Windows)', -'Topic :: Adaptive Technologies' -'Intended Audience :: Developers', -'Intended Audience :: End Users/Desktop', -'License :: OSI Approved :: GNU General Public License (GPL)', -'Natural Language :: English', -'Programming Language :: Python', -'Operating System :: Microsoft :: Windows', -], - cmdclass={"py2exe": py2exe}, - windows=[ - { - "script":"nvda.pyw", - "dest_base":"nvda_noUIAccess", - "uiAccess": False, - "icon_resources":[(1,"images/nvda.ico")], - "other_resources": [], # Populated at run time - "version":formatBuildVersionString(), - "description":"NVDA application", - "product_name":name, - "product_version":version, + +def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: + return ( + RT_MANIFEST, + 1, + (_manifestTemplate % {"uiAccess": shouldHaveUIAccess}).encode("utf-8") + ) + + +_py2ExeWindows = [ + { + "script": "nvda.pyw", + "dest_base": "nvda_noUIAccess", + "icon_resources": [(1, "images/nvda.ico")], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=False)], + "version_info": { + "version": formatBuildVersionString(), + "description": "NVDA application (no UIAccess)", + "product_name": name, + "product_version": version, "copyright": NVDAcopyright, - "company_name":publisher, - }, - # The nvda_uiAccess target will be added at runtime if required. - { - "script": "nvda_slave.pyw", - "uiAccess": False, - "icon_resources": [(1,"images/nvda.ico")], - "other_resources": [], # Populated at run time - "version":formatBuildVersionString(), - "description": name, - "product_name":name, + "company_name": publisher, + } + }, + # The nvda_uiAccess target will be added at runtime if required. + { + "script": "nvda_slave.pyw", + "icon_resources": [(1, "images/nvda.ico")], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=False)], + "version_info": { + "version": formatBuildVersionString(), + "description": description, + "product_name": name, "product_version": version, "copyright": NVDAcopyright, "company_name": publisher, - }, - { - "script": "nvda_eoaProxy.pyw", - # uiAccess will be enabled at runtime if appropriate. - "uiAccess": False, - "icon_resources": [(1,"images/nvda.ico")], - "other_resources": [], # Populated at run time - "version":formatBuildVersionString(), - "description": "NVDA Ease of Access proxy", - "product_name":name, + } + }, +] +if _partialArgs.uiAccess: + _py2ExeWindows.insert(1, { + "script": "nvda.pyw", + "dest_base": "nvda_uiAccess", + "icon_resources": [(1, "images/nvda.ico")], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=True)], + "version_info": { + "version": formatBuildVersionString(), + "description": "NVDA application (has UIAccess)", + "product_name": name, "product_version": version, "copyright": NVDAcopyright, "company_name": publisher, - }, - ], + } + }) + + +freeze( + version_info={ + "version": formatBuildVersionString(), + "description": description, + "product_name": name, + "product_version": version, + "copyright": NVDAcopyright, + "company_name": publisher, + }, + windows=_py2ExeWindows, console=[ { "script": os.path.join("..", "include", "nvda_dmp", "nvda_dmp.py"), - "uiAccess": False, "icon_resources": [(1, "images/nvda.ico")], - "other_resources": [], # Populated at runtime - "version":formatBuildVersionString(), - "description": "NVDA Diff-match-patch proxy", - "product_name": name, - "product_version": version, - "copyright": f"{NVDAcopyright}, Bill Dengler", - "company_name": f"Bill Dengler, {publisher}", + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=False)], + "version_info": { + "version": formatBuildVersionString(), + "description": "NVDA Diff-match-patch proxy", + "product_name": name, + "product_version": version, + "copyright": f"{NVDAcopyright}, Bill Dengler", + "company_name": f"Bill Dengler, {publisher}", + }, }, ], - options = {"py2exe": { + options={ + "verbose": 2, + "optimize": 0, "bundle_files": 3, + "dist_dir": "../dist", "excludes": [ "tkinter", "serial.loopback_connection", @@ -230,7 +224,7 @@ def getRecursiveDataFiles(dest,source,excludes=()): # robotremoteserver (for system tests) depends on xmlrpc.server "xmlrpc.server", ], - }}, + }, data_files=[ (".",glob("*.dll")+glob("*.manifest")+["builtin.dic"]), ("documentation", ['../copying.txt', '../contributors.txt']), diff --git a/source/winVersion.py b/source/winVersion.py index 6eb8ab5cd14..3a8a31aaae5 100644 --- a/source/winVersion.py +++ b/source/winVersion.py @@ -200,8 +200,8 @@ def getWinVer(): def isSupportedOS(): - # NVDA can only run on Windows 7 Service pack 1 and above - return getWinVer() >= WIN7_SP1 + # NVDA can only run on Windows 8.1 (Blue) and above + return getWinVer() >= WIN81 UWP_OCR_DATA_PATH = os.path.expandvars(r"$windir\OCR") diff --git a/tests/system/robot/NVDAInstaller.robot b/tests/system/robot/NVDAInstaller.robot index 1c4d20f18ff..4748515b91d 100644 --- a/tests/system/robot/NVDAInstaller.robot +++ b/tests/system/robot/NVDAInstaller.robot @@ -25,8 +25,6 @@ default teardown default startup start NVDAInstaller standard-dontShowWelcomeDialog.ini -default pass execution - *** Test Cases *** Read install dialog diff --git a/tests/unit/test_baseObject.py b/tests/unit/test_baseObject.py index a1729e4543d..eba89c5af6c 100644 --- a/tests/unit/test_baseObject.py +++ b/tests/unit/test_baseObject.py @@ -137,16 +137,18 @@ class TestAbstractAutoPropertyObjects(unittest.TestCase): """ def test_abstractProperty(self): - self.assertRaisesRegex(TypeError, + self.assertRaisesRegex( + TypeError, "^Can't instantiate abstract class AutoPropertyObjectWithAbstractProperty " - "with abstract methods x", + "with abstract method x", AutoPropertyObjectWithAbstractProperty ) def test_subclassedAbstractProperty(self): - self.assertRaisesRegex(TypeError, + self.assertRaisesRegex( + TypeError, "^Can't instantiate abstract class SubclassedAutoPropertyObjectWithAbstractProperty " - "with abstract methods x", + "with abstract method x", SubclassedAutoPropertyObjectWithAbstractProperty ) diff --git a/tests/unit/test_braille/test_brailleDisplayDrivers.py b/tests/unit/test_braille/test_brailleDisplayDrivers.py index 63d414417a8..e729fa12055 100644 --- a/tests/unit/test_braille/test_brailleDisplayDrivers.py +++ b/tests/unit/test_braille/test_brailleDisplayDrivers.py @@ -171,6 +171,7 @@ def test_identifiers(self): class TestBRLTTY(unittest.TestCase): """Tests the integrity of the bundled brlapi module.""" + @unittest.skip("BRLAPI is temporarily unavailable in NVDA alpha during the python upgrade for 2024.1") def test_brlapi(self): try: # SUpress Flake8 F401 imported but unused, as we're testing the import diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 32b63bed5bd..d1bce38675e 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -13,6 +13,8 @@ What's New in NVDA == Changes == +- NVDA no longer supports Windows 7 and Windows 8. +Windows 8.1 is the minimum Windows version supported. (#15544) - Updated LibLouis braille translator to 3.27.0. (#15435, @codeofdusk) - Added new Thai and Romanian Braille tables. - @@ -37,9 +39,6 @@ Please refer to [the developer guide https://www.nvaccess.org/files/nvda/documen - Note: this is an Add-on API compatibility breaking release. Add-ons will need to be re-tested and have their manifest updated. -- Updated Comtypes to version 1.2.0. (#15513) -- Updated fast_diff_match_patch to version 2.0.1. (#15514) -- Updated SCons to version 4.5.2. (#15529) - Added extension point: ``treeInterceptorHandler.post_browseModeStateChange``. (#14969, @nvdaes) - @@ -47,6 +46,21 @@ Add-ons will need to be re-tested and have their manifest updated. These are breaking API changes. Please open a GitHub issue if your Add-on has an issue with updating to the new API. +- NVDA is now built with Python 3.11. (#12064) +- Updated pip dependencies: + - configobj to 5.1.0dev commit e2ba4457. (#15544) + - Comtypes to 1.2.0. (#15513, @codeofdusk) + - fast_diff_match_patch to 2.0.1. (#15514, @codeofdusk) + - py2exe to 0.13.0.1dev commit 4e7b2b2c60face592e67cb1bc935172a20fa371d. (#15544) + - robotframework to 6.1.1. (#15544) + - SCons to 4.5.2. (#15529) + - sphinx to 7.2.6. (#15544) + - wxPython to 4.2.1. (#12551) + - +- Removed pip dependencies: + - typing_extensions, these should be supported natively in Python 3.11 (#15544) + - nose, instead unittest-xml-reporting is used to generate XML reports. (#15544) + - - ``IAccessibleHandler.SecureDesktopNVDAObject`` has been removed. Instead, when NVDA is running on the user profile, track the existence of the secure desktop with the extension point: ``winAPI.secureDesktop.post_secureDesktopStateChange``. (#14488) - ``braille.BrailleHandler.handlePendingCaretUpdate`` has been removed with no public replacement. (#15163, @LeonarddeR) diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index 62abc037677..f0f3ebf51c4 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -39,9 +39,7 @@ Major highlights include: - ++ System Requirements ++[SystemRequirements] -- Operating Systems: all 32-bit and 64-bit editions of Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, and all Server Operating Systems starting from Windows Server 2008 R2. - - For Windows 7, NVDA requires Service Pack 1 or higher. - - For Windows Server 2008 R2, NVDA requires Service Pack 1 or higher. +- Operating Systems: all 32-bit and 64-bit editions of Windows 8.1, Windows 10, Windows 11, and all Server Operating Systems starting from Windows Server 2012 R2. - both AMD64 and ARM64 variants of Windows are supported. - - at least 150 MB of storage space. @@ -2938,7 +2936,7 @@ For an even more extensive list of free and commercial synthesizers that you ca ++ eSpeak NG ++[eSpeakNG] The [eSpeak NG https://github.com/espeak-ng/espeak-ng] synthesizer is built directly into NVDA and does not require any other special drivers or components to be installed. -On Windows 7, 8 and 8.1, NVDA uses eSpeak NG by default ([Windows OneCore #OneCore] is used in Windows 10 and later by default). +On Windows 8.1 NVDA uses eSpeak NG by default ([Windows OneCore #OneCore] is used in Windows 10 and later by default). As this synthesizer is built into NVDA, this is a great choice for when running NVDA off a USB thumb drive on other systems. Each voice that comes with eSpeak NG speaks a different language. diff --git a/venvUtils/ensureAndActivate.bat b/venvUtils/ensureAndActivate.bat index 909b1fc929f..82046fd434f 100644 --- a/venvUtils/ensureAndActivate.bat +++ b/venvUtils/ensureAndActivate.bat @@ -9,7 +9,7 @@ set scriptsDir=%here% set venvLocation=%here%\..\.venv rem Ensure the environment is created and up to date -py -3.7-32 "%scriptsDir%\ensureVenv.py" +py -3.11-32 "%scriptsDir%\ensureVenv.py" if ERRORLEVEL 1 goto :EOF rem Set the necessary environment variables to have Python use this virtual environment. diff --git a/venvUtils/ensureVenv.py b/venvUtils/ensureVenv.py index 5918494e5a0..c8d6026944a 100644 --- a/venvUtils/ensureVenv.py +++ b/venvUtils/ensureVenv.py @@ -173,15 +173,4 @@ def ensureVenvAndRequirements(): "Please deactivate the current Python virtual environment and try again." ) sys.exit(1) - if ( - sys.version_info.minor == 7 - and sys.version_info.micro == 6 - ): - # #10696: Building with Python 3.7.6 fails. Inform user and exit. - Py376FailMsg = ( - "Error: Building with Python 3.7.6 is not possible.\n" - "Please use a more recent version of Python 3." - ) - print(Py376FailMsg) - sys.exit(1) ensureVenvAndRequirements()