From 0b18089cbe06953a447a3a925773f5f81d942392 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 28 Sep 2023 11:54:10 +1000 Subject: [PATCH 01/30] Update to Python 3.11 --- appveyor.yml | 2 +- nvdaHelper/readme.md | 4 ++-- projectDocs/dev/createDevEnvironment.md | 2 +- requirements.txt | 27 +++++++++---------------- sconstruct | 4 ++-- source/UIAHandler/types.py | 2 -- source/_addonStore/models/addon.py | 4 +--- source/_addonStore/models/status.py | 4 +--- source/_addonStore/models/version.py | 2 +- source/config/aggregatedSection.py | 2 +- source/config/featureFlagEnums.py | 5 +---- source/globalVars.py | 2 +- source/louisHelper.py | 12 +++++++---- user_docs/en/userGuide.t2t | 6 ++---- venvUtils/ensureAndActivate.bat | 2 +- venvUtils/ensureVenv.py | 11 ---------- 16 files changed, 33 insertions(+), 58 deletions(-) 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/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 1880fed7d49..1893df46166 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..b34606f9002 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,28 +4,21 @@ 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 +configobj==5.0.8 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 +py2exe==0.13.0.0 # For building developer documentation -sphinx==5.1.1 -sphinx_rtd_theme==1.0.0 - -# Requirements for type checking. -# typing_extensions is incorporated in py3.8+, also available via mypy -typing_extensions==4.3.0 +sphinx==7.2.6 +sphinx_rtd_theme==1.3.0 # Requirements for automated linting flake8 ~= 3.7.7 @@ -35,6 +28,6 @@ flake8-tabs == 2.1.0 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/sconstruct b/sconstruct index 8eaaeb2d884..edb1b9d8f7f 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) 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/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/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index 9612152d0c9..17598f4ca77 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. - both AMD64 and ARM64 variants of Windows are supported. - - at least 150 MB of storage space. @@ -2935,7 +2933,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() From d69c98f4e7d0cf413862025f0950824305c5f574 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 28 Sep 2023 12:08:36 +1000 Subject: [PATCH 02/30] update changes --- user_docs/en/changes.t2t | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 26ac52dd014..6925ded7f9b 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -28,9 +28,17 @@ 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) +- NVDA is now built with Python 3.11 (#12064) +- Updated pip dependencies: + - configobj to 5.0.8. (#15544) + - Comtypes to 1.2.0. (#15513) + - fast_diff_match_patch to 2.0.1. (#15514) + - py2exe to 0.13.0.0. (#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) + - - Added extension point: ``treeInterceptorHandler.post_browseModeStateChange``. (#14969) - From ce599793fcc1882899f4124075c989b7a45fecd5 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 28 Sep 2023 14:48:06 +1000 Subject: [PATCH 03/30] fix py2exe --- nvdaHelper/archBuild_sconscript | 19 +--- requirements.txt | 7 +- sconstruct | 3 +- source/setup.py | 184 +++++++++++++------------------- 4 files changed, 87 insertions(+), 126 deletions(-) diff --git a/nvdaHelper/archBuild_sconscript b/nvdaHelper/archBuild_sconscript index 8b55ccf550d..1afdad850f8 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', diff --git a/requirements.txt b/requirements.txt index b34606f9002..97b44922e91 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ SCons==4.5.2 comtypes==1.2.0 pyserial==3.5 wxPython==4.2.1 -configobj==5.0.8 +git+https://github.com/DiffSK/configobj@e2ba445#egg=configobj requests==2.31.0 # 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" @@ -15,6 +15,11 @@ fast_diff_match_patch==2.0.1 # Packaging NVDA py2exe==0.13.0.0 +# py2exe fails to compile properly without this. +# This can be removed when upgrading py2exe to the next release. +# https://github.com/Ousret/charset_normalizer/issues/253 +# https://github.com/py2exe/py2exe/commit/7b34f06486fbc07500e323796d3f3d5fb862aee3 +charset-normalizer==2.1.1 # For building developer documentation sphinx==7.2.6 diff --git a/sconstruct b/sconstruct index edb1b9d8f7f..5315e3bd9c6 100755 --- a/sconstruct +++ b/sconstruct @@ -314,8 +314,7 @@ def NVDADistGenerator(target, source, env, for_signature): 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)) + buildCmd.extend(("setup.py", "-vv", "build", "--build-base", buildDir.abspath, "--dist-dir", target[0].abspath)) if release: buildCmd.append("-O1") if env.get("uiAccess"): diff --git a/source/setup.py b/source/setup.py index 80f5dc95adc..ef3cac7c31f 100755 --- a/source/setup.py +++ b/source/setup.py @@ -1,18 +1,15 @@ # -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2006-2022 NV Access Limited, Peter Vágner, Joseph Lee +# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Joseph Lee # This file is covered by the GNU General Public License. # See the file COPYING for more details. +import argparse import os import sys -import copy import gettext +from typing import Tuple gettext.install("nvda") -from setuptools import setup -# While the import of py2exe appears unused it is required. -# py2exe monkey patches distutils when importing py2exe for the first time. -import py2exe as py2exeModule # noqa: F401, E402 from glob import glob import fnmatch # versionInfo names must be imported after Gettext @@ -23,11 +20,10 @@ formatBuildVersionString, name, publisher, - url, version, ) # noqa: E402 -from py2exe import distutils_buildexe -from py2exe.dllfinder import DllFinder +from py2exe import freeze # noqa: E402 +from py2exe.dllfinder import DllFinder # noqa: E402 import wx import importlib.machinery # Explicitly put the nvda_dmp dir on the build path so the DMP library is included @@ -46,43 +42,29 @@ def determine_dll_type(self, imagename): return orig_determine_dll_type(self, imagename) DllFinder.determine_dll_type = determine_dll_type -class py2exe(distutils_buildexe.py2exe): - """Overridden py2exe command to: - * Add a command line option --enable-uiAccess to enable uiAccess for the main executable and EOA proxy - * Add a manifest to the executables + +def _parsePartialArguments() -> 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" + ) + partialArgs, _argslist = partialParser.parse_known_args("--enable-uiAccess") + 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,64 @@ 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, - "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, - "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, - "product_version": version, - "copyright": NVDAcopyright, - "company_name": publisher, - }, - ], + +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)], + }, + # 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)], + }, + { + "script": "nvda_eoaProxy.pyw", + "icon_resources": [(1, "images/nvda.ico")], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=_partialArgs.uiAccess)], + }, +] +if _partialArgs.uiAccess: + _py2ExeWindows.insert(1, { + "script": "nvda.pyw", + "dest_base": "nvda_uiAccess", + "icon_resources": [(1, "images/nvda.ico")], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=True)], + }) + + +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": [], }, ], - options = {"py2exe": { + options={ "bundle_files": 3, + "dist_dir": "../dist", "excludes": [ "tkinter", "serial.loopback_connection", @@ -230,7 +196,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']), From 465ed7166b0ec2536abaeace512744c2295fa7bb Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 28 Sep 2023 17:40:07 +1000 Subject: [PATCH 04/30] fix compile --- nvdaHelper/local/nvdaHelperLocal.cpp | 29 ++++------------------------ 1 file changed, 4 insertions(+), 25 deletions(-) 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; From 5bd87a6dd712f4712c2a508ed36d17e1ba888a6a Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 28 Sep 2023 18:05:27 +1000 Subject: [PATCH 05/30] update linker subsystem --- nvdaHelper/archBuild_sconscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nvdaHelper/archBuild_sconscript b/nvdaHelper/archBuild_sconscript index 1afdad850f8..d81b4ae6fd2 100644 --- a/nvdaHelper/archBuild_sconscript +++ b/nvdaHelper/archBuild_sconscript @@ -93,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', From 573a09f9b2ba6817f37edfc0f81b908652b33462 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 10:36:56 +1100 Subject: [PATCH 06/30] fixup isSupportedOS --- source/winVersion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/winVersion.py b/source/winVersion.py index 7bcfd8271ec..144adaec74b 100644 --- a/source/winVersion.py +++ b/source/winVersion.py @@ -198,8 +198,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") From 0acdbe9d12c97e35142d99205def3859651df620 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 11:53:03 +1100 Subject: [PATCH 07/30] drop nose as dependency --- requirements.txt | 5 +---- rununittests.bat | 2 +- user_docs/en/changes.t2t | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 97b44922e91..beeb7581b05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ SCons==4.5.2 comtypes==1.2.0 pyserial==3.5 wxPython==4.2.1 -git+https://github.com/DiffSK/configobj@e2ba445#egg=configobj +git+https://github.com/DiffSK/configobj@e2ba4457c4651fa54f8d59d8dcdd3da950e956b8#egg=configobj requests==2.31.0 # 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" @@ -29,9 +29,6 @@ sphinx_rtd_theme==1.3.0 flake8 ~= 3.7.7 flake8-tabs == 2.1.0 -# Requirements for unit tests -nose==1.3.7 - # Requirements for system tests robotframework==6.1.1 robotremoteserver==1.1.1 diff --git a/rununittests.bat b/rununittests.bat index 49d96d78a16..a91d2a11f7c 100644 --- a/rununittests.bat +++ b/rununittests.bat @@ -5,4 +5,4 @@ if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% set scriptsDir=%here%\venvUtils set unitTestsPath=%here%\tests\unit -call "%scriptsDir%\venvCmd.bat" py -m nose -sv --traverse-namespace -w "%unitTestsPath%" %* +call "%scriptsDir%\venvCmd.bat" py -m unittest discover -v -s "%unitTestsPath%" -t "%here%" %* diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 6925ded7f9b..676f40160f8 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -46,6 +46,10 @@ 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. +- Removed pip dependencies: + - typing_extensions (#15544) + - nose (#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) From cf5f960d30a07fb10132a3b98ca7550158126f67 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 11:56:01 +1100 Subject: [PATCH 08/30] fix server 2012 r2 ref --- user_docs/en/userGuide.t2t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_docs/en/userGuide.t2t b/user_docs/en/userGuide.t2t index 17598f4ca77..976c6724764 100644 --- a/user_docs/en/userGuide.t2t +++ b/user_docs/en/userGuide.t2t @@ -39,7 +39,7 @@ Major highlights include: - ++ System Requirements ++[SystemRequirements] -- 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. +- 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. From c6fcafa0678fc50afc237d049a65480ec611d738 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 12:22:23 +1100 Subject: [PATCH 09/30] use xmlrunner for xml unit test output --- appveyor/scripts/tests/unitTests.ps1 | 2 +- requirements.txt | 3 +++ rununittests.bat | 4 +++- user_docs/en/changes.t2t | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) 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/requirements.txt b/requirements.txt index beeb7581b05..f86b4de02b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,6 +21,9 @@ py2exe==0.13.0.0 # https://github.com/py2exe/py2exe/commit/7b34f06486fbc07500e323796d3f3d5fb862aee3 charset-normalizer==2.1.1 +# Creating XML unit test reports +unittest-xml-reporting==3.2.0 + # For building developer documentation sphinx==7.2.6 sphinx_rtd_theme==1.3.0 diff --git a/rununittests.bat b/rununittests.bat index a91d2a11f7c..138e77bd19e 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 unittest discover -v -s "%unitTestsPath%" -t "%here%" %* +call "%scriptsDir%\venvCmd.bat" py -m xmlrunner discover -v -s "%unitTestsPath%" -t "%here%" --output-file "%testOutput%\report.xml" %* diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 676f40160f8..cc6821d2189 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -47,8 +47,8 @@ These are breaking API changes. Please open a GitHub issue if your Add-on has an issue with updating to the new API. - Removed pip dependencies: - - typing_extensions (#15544) - - nose (#15544) + - 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) From 5e99bc65d425574a1ae36ec2a90b30447915e428 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 12:24:33 +1100 Subject: [PATCH 10/30] fix unit test report name --- rununittests.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rununittests.bat b/rununittests.bat index 138e77bd19e..f2782d0e696 100644 --- a/rununittests.bat +++ b/rununittests.bat @@ -7,4 +7,4 @@ set unitTestsPath=%here%\tests\unit set testOutput=%here%\testOutput\unit md %testOutput% -call "%scriptsDir%\venvCmd.bat" py -m xmlrunner discover -v -s "%unitTestsPath%" -t "%here%" --output-file "%testOutput%\report.xml" %* +call "%scriptsDir%\venvCmd.bat" py -m xmlrunner discover -v -s "%unitTestsPath%" -t "%here%" --output-file "%testOutput%\unitTests.xml" %* From 6145669873f923b55f8d5a5154ee32f7ba2be7fe Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 12:58:56 +1100 Subject: [PATCH 11/30] fix abstract method unit test regex changes --- tests/unit/test_baseObject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_baseObject.py b/tests/unit/test_baseObject.py index a1729e4543d..8072da74866 100644 --- a/tests/unit/test_baseObject.py +++ b/tests/unit/test_baseObject.py @@ -139,14 +139,14 @@ class TestAbstractAutoPropertyObjects(unittest.TestCase): def test_abstractProperty(self): 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, "^Can't instantiate abstract class SubclassedAutoPropertyObjectWithAbstractProperty " - "with abstract methods x", + "with abstract method x", SubclassedAutoPropertyObjectWithAbstractProperty ) From 0b1a9b7d5c6583cbcf904ae679d797f9703b6d76 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 14:28:49 +1100 Subject: [PATCH 12/30] fix lint --- tests/unit/test_baseObject.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_baseObject.py b/tests/unit/test_baseObject.py index 8072da74866..eba89c5af6c 100644 --- a/tests/unit/test_baseObject.py +++ b/tests/unit/test_baseObject.py @@ -137,14 +137,16 @@ class TestAbstractAutoPropertyObjects(unittest.TestCase): """ def test_abstractProperty(self): - self.assertRaisesRegex(TypeError, + self.assertRaisesRegex( + TypeError, "^Can't instantiate abstract class AutoPropertyObjectWithAbstractProperty " "with abstract method x", AutoPropertyObjectWithAbstractProperty ) def test_subclassedAbstractProperty(self): - self.assertRaisesRegex(TypeError, + self.assertRaisesRegex( + TypeError, "^Can't instantiate abstract class SubclassedAutoPropertyObjectWithAbstractProperty " "with abstract method x", SubclassedAutoPropertyObjectWithAbstractProperty From 35af8042339b8daece350f289518d063002ebe31 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 14:30:47 +1100 Subject: [PATCH 13/30] remove unused keyword --- tests/system/robot/NVDAInstaller.robot | 2 -- 1 file changed, 2 deletions(-) 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 From 0d6970bf785ee7dd831230c786e14291a0a91365 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 14:47:15 +1100 Subject: [PATCH 14/30] upgrade optimization level to 2 --- sconstruct | 2 -- source/setup.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sconstruct b/sconstruct index 5315e3bd9c6..93f06abe5f4 100755 --- a/sconstruct +++ b/sconstruct @@ -315,8 +315,6 @@ def NVDADistGenerator(target, source, env, for_signature): # Issue errors about str(bytes_instance), str(bytearray_instance) buildCmd.append("-bb") buildCmd.extend(("setup.py", "-vv", "build", "--build-base", buildDir.abspath, "--dist-dir", target[0].abspath)) - if release: - buildCmd.append("-O1") if env.get("uiAccess"): buildCmd.append("--enable-uiAccess") diff --git a/source/setup.py b/source/setup.py index ef3cac7c31f..92fe456f28d 100755 --- a/source/setup.py +++ b/source/setup.py @@ -148,6 +148,7 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> Tuple[int, int, bytes]: }, ], options={ + "optimize": 2, "bundle_files": 3, "dist_dir": "../dist", "excludes": [ From d9aa2cdea2e14d1cee025f36297662e0adfb824f Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 3 Oct 2023 15:02:56 +1100 Subject: [PATCH 15/30] fix uiaccess parsing --- source/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/setup.py b/source/setup.py index 92fe456f28d..2f2b8859b02 100755 --- a/source/setup.py +++ b/source/setup.py @@ -55,7 +55,7 @@ def _parsePartialArguments() -> argparse.Namespace: action="store_true", help="enable uiAccess for the main executable" ) - partialArgs, _argslist = partialParser.parse_known_args("--enable-uiAccess") + partialArgs, _argslist = partialParser.parse_known_args(("--enable-uiAccess", )) return partialArgs From 4c2ac86fb36b36740c941c6be8f6f897a31c904e Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Wed, 4 Oct 2023 09:53:06 +1100 Subject: [PATCH 16/30] use round not int --- source/gui/dpiScalingHelper.py | 4 ++-- user_docs/en/changes.t2t | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/gui/dpiScalingHelper.py b/source/gui/dpiScalingHelper.py index 12f8065a9b5..8c0a71b6d6c 100644 --- a/source/gui/dpiScalingHelper.py +++ b/source/gui/dpiScalingHelper.py @@ -17,8 +17,8 @@ def scaleSize(scaleFactor: float, size: _Size) -> _ScaledSize: @returns: The scaled size, as a tuple or a single numerical type. """ if isinstance(size, tuple): - return (int(scaleFactor * size[0]), int(scaleFactor * size[1])) - return int(scaleFactor * size) + return (round(scaleFactor * size[0]), round(scaleFactor * size[1])) + return round(scaleFactor * size) def getScaleFactor(windowHandle: int) -> float: diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index cc6821d2189..0547eebc7ee 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -28,6 +28,13 @@ 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. +- Added extension point: ``treeInterceptorHandler.post_browseModeStateChange``. (#14969) +- + +=== API Breaking Changes === +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.0.8. (#15544) @@ -39,13 +46,6 @@ Add-ons will need to be re-tested and have their manifest updated. - sphinx to 7.2.6. (#15544) - wxPython to 4.2.1 (#12551) - -- Added extension point: ``treeInterceptorHandler.post_browseModeStateChange``. (#14969) -- - -=== API Breaking Changes === -These are breaking API changes. -Please open a GitHub issue if your Add-on has an issue with updating to the new API. - - 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) From ef044ae69eba729dbdf4f2bea8ade005f866d224 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Wed, 4 Oct 2023 10:04:21 +1100 Subject: [PATCH 17/30] fixup configobj changes ref --- user_docs/en/changes.t2t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 0547eebc7ee..f3731926dbd 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -37,7 +37,7 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new - NVDA is now built with Python 3.11 (#12064) - Updated pip dependencies: - - configobj to 5.0.8. (#15544) + - Updated configobj to 5.1.0dev commit e2ba4457. (#15544) - Comtypes to 1.2.0. (#15513) - fast_diff_match_patch to 2.0.1. (#15514) - py2exe to 0.13.0.0. (#15544) From f3c3d14bd43916b0e1daa3aa58df523e786551d1 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Wed, 4 Oct 2023 12:29:11 +1100 Subject: [PATCH 18/30] fix up changes syntax --- user_docs/en/changes.t2t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 7784ced97cc..e5a8646915b 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -38,7 +38,7 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new - NVDA is now built with Python 3.11 (#12064) - Updated pip dependencies: - - Updated configobj to 5.1.0dev commit e2ba4457. (#15544) + - configobj to 5.1.0dev commit e2ba4457. (#15544) - Comtypes to 1.2.0. (#15513) - fast_diff_match_patch to 2.0.1. (#15514) - py2exe to 0.13.0.0. (#15544) From f619ccc2892e4918a7c3573114190e347f1e0e9d Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Wed, 4 Oct 2023 12:29:56 +1100 Subject: [PATCH 19/30] fix up changes syntax --- user_docs/en/changes.t2t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index e5a8646915b..1d30e6c7fbe 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -36,7 +36,7 @@ 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) +- 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) @@ -45,7 +45,7 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new - robotframework to 6.1.1. (#15544) - SCons to 4.5.2. (#15529) - sphinx to 7.2.6. (#15544) - - wxPython to 4.2.1 (#12551) + - wxPython to 4.2.1. (#12551) - - Removed pip dependencies: - typing_extensions, these should be supported natively in Python 3.11 (#15544) From c2e9fff66278a411be22b642a8941d170c08f608 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Wed, 4 Oct 2023 12:37:32 +1100 Subject: [PATCH 20/30] update manifest template to drop win7/8 support --- source/manifest.template.xml | 8 -------- 1 file changed, 8 deletions(-) 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 @@ - - - - Date: Thu, 5 Oct 2023 12:34:11 +1100 Subject: [PATCH 21/30] remove eoaProxy --- appx/sconscript | 4 +-- sconstruct | 2 +- source/installer.py | 63 ++++++++++++++++++++++++++-------------- source/nvda_eoaProxy.pyw | 60 -------------------------------------- source/setup.py | 5 ---- 5 files changed, 43 insertions(+), 91 deletions(-) delete mode 100644 source/nvda_eoaProxy.pyw 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/sconstruct b/sconstruct index 93f06abe5f4..8b2e03ba905 100755 --- a/sconstruct +++ b/sconstruct @@ -343,7 +343,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/installer.py b/source/installer.py index f809bf2b3e8..9b0e884b3a1 100644 --- a/source/installer.py +++ b/source/installer.py @@ -698,25 +698,44 @@ 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/nvda_eoaProxy.pyw b/source/nvda_eoaProxy.pyw deleted file mode 100644 index dd9669d8daf..00000000000 --- a/source/nvda_eoaProxy.pyw +++ /dev/null @@ -1,60 +0,0 @@ -#nvda_eoaProxy.pyw -#A part of NonVisual Desktop Access (NVDA) -#Copyright (C) 2014 NV Access Limited -#This file is covered by the GNU General Public License. -#See the file COPYING for more details. - -"""NVDA proxy process for Ease of Access in Windows Vista/7. -This version of Ease of Access terminates ATs on every desktop switch, -but this is bad for NVDA, as state is lost and cleanup isn't performed. -This process runs while NVDA is running so EoA knows NVDA is running. -However, when EoA kills this process, it doesn't affect NVDA. -""" - -import sys -import os -import ctypes -import winUser -import winKernel - -def getNvdaProcess(): - try: - window = winUser.FindWindow(u"wxWindowClassNR", u"NVDA") - except WindowsError: - return None - pid = winUser.getWindowThreadProcessID(window)[0] - return winKernel.openProcess(winKernel.SYNCHRONIZE, False, pid) - -UOI_NAME = 2 -def isSecureDesktop(): - desktop = ctypes.windll.user32.OpenInputDesktop(0, False, 0) - name = ctypes.create_unicode_buffer(256) - ctypes.windll.user32.GetUserObjectInformationW(desktop, UOI_NAME, ctypes.byref(name), ctypes.sizeof(name), None) - ctypes.windll.user32.CloseDesktop(desktop) - return name.value == "Winlogon" - -def waitForNvdaStart(): - # Wait up to 10 seconds for NVDA to start. - for attempt in range(11): - process = getNvdaProcess() - if process: - return process - import time - time.sleep(1) - return None - -def main(): - process = getNvdaProcess() - if not process: - if isSecureDesktop(): - import subprocess - subprocess.Popen((os.path.join(sys.prefix, "nvda.exe"), "--ease-of-access")) - process = waitForNvdaStart() - if not process: - return - # Wait for NVDA to exit. - winKernel.waitForSingleObject(process, winKernel.INFINITE) - winKernel.closeHandle(process) - -if __name__ == "__main__": - main() diff --git a/source/setup.py b/source/setup.py index 2f2b8859b02..904a5758f2c 100755 --- a/source/setup.py +++ b/source/setup.py @@ -114,11 +114,6 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> Tuple[int, int, bytes]: "icon_resources": [(1, "images/nvda.ico")], "other_resources": [_genManifestTemplate(shouldHaveUIAccess=False)], }, - { - "script": "nvda_eoaProxy.pyw", - "icon_resources": [(1, "images/nvda.ico")], - "other_resources": [_genManifestTemplate(shouldHaveUIAccess=_partialArgs.uiAccess)], - }, ] if _partialArgs.uiAccess: _py2ExeWindows.insert(1, { From 55d6ca5eb202de421325930847f889a3f65d755d Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 5 Oct 2023 12:41:58 +1100 Subject: [PATCH 22/30] lower optimization level to 0 --- source/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/setup.py b/source/setup.py index 904a5758f2c..23e91a5f049 100755 --- a/source/setup.py +++ b/source/setup.py @@ -143,7 +143,7 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> Tuple[int, int, bytes]: }, ], options={ - "optimize": 2, + "optimize": 0, "bundle_files": 3, "dist_dir": "../dist", "excludes": [ From 563048ca6a2aecfcc6192b681f30519720e2e31c Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 5 Oct 2023 15:38:46 +1100 Subject: [PATCH 23/30] update changes --- user_docs/en/changes.t2t | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 1d30e6c7fbe..fc2a05377f4 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) - The following commands now support two and three presses to spell the reported information and spell with character descriptions: report selection, report clipboard text and report focused object. (#15449) - The option "Report role when mouse enters object" in NVDA's mouse settings category has been renamed to "Report object when mouse enters it". This option now announces additional relevant information about an object when the mouse enters it, such as states (checked/pressed) or cell coordinates in a table. (#15420) From 0d7dd06f70540eb3cc23824662cf29c6ce61a0af Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Thu, 5 Oct 2023 15:40:12 +1100 Subject: [PATCH 24/30] fix lint --- source/installer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/installer.py b/source/installer.py index 9b0e884b3a1..d5f9acb764c 100644 --- a/source/installer.py +++ b/source/installer.py @@ -719,7 +719,8 @@ def registerEaseOfAccess(installDir): winreg.REG_SZ, "nvda.exe" ) - winreg.SetValueEx(appKey, + winreg.SetValueEx( + appKey, "StartExe", None, winreg.REG_SZ, From 0cb887b8161bf489a371f1fc0e0ee01434430867 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Mon, 9 Oct 2023 11:27:44 +1100 Subject: [PATCH 25/30] fix typing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Golonka --- source/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/setup.py b/source/setup.py index 23e91a5f049..46a119a81a8 100755 --- a/source/setup.py +++ b/source/setup.py @@ -8,7 +8,6 @@ import os import sys import gettext -from typing import Tuple gettext.install("nvda") from glob import glob import fnmatch @@ -93,7 +92,7 @@ def getRecursiveDataFiles(dest,source,excludes=()): return rulesList -def _genManifestTemplate(shouldHaveUIAccess: bool) -> Tuple[int, int, bytes]: +def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: return ( RT_MANIFEST, 1, From b8124fb180a6cd43760e717dc177c5f4efa91104 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Mon, 9 Oct 2023 13:46:05 +1100 Subject: [PATCH 26/30] update py2exe --- requirements.txt | 7 +------ source/setup.py | 32 ++++++++++++++++++++++++++++++++ user_docs/en/changes.t2t | 2 +- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index f86b4de02b7..4e0e409be19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,12 +14,7 @@ Pillow==10.0.1 -C "zlib=disable" -C "jpeg=disable" fast_diff_match_patch==2.0.1 # Packaging NVDA -py2exe==0.13.0.0 -# py2exe fails to compile properly without this. -# This can be removed when upgrading py2exe to the next release. -# https://github.com/Ousret/charset_normalizer/issues/253 -# https://github.com/py2exe/py2exe/commit/7b34f06486fbc07500e323796d3f3d5fb862aee3 -charset-normalizer==2.1.1 +git+https://github.com/py2exe/py2exe@4e7b2b2c60face592e67cb1bc935172a20fa371d#egg=py2exe # Creating XML unit test reports unittest-xml-reporting==3.2.0 diff --git a/source/setup.py b/source/setup.py index 46a119a81a8..f94b7a27528 100755 --- a/source/setup.py +++ b/source/setup.py @@ -106,12 +106,28 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: "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", "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, + } }, ] if _partialArgs.uiAccess: @@ -120,6 +136,14 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: "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, + } }) @@ -139,6 +163,14 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: "uiAccess": False, "icon_resources": [(1, "images/nvda.ico")], "other_resources": [], + "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={ diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 938fb6eebae..a9fb5e3782c 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -47,7 +47,7 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new - configobj to 5.1.0dev commit e2ba4457. (#15544) - Comtypes to 1.2.0. (#15513) - fast_diff_match_patch to 2.0.1. (#15514) - - py2exe to 0.13.0.0. (#15544) + - 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) From 2385662b6274a4790eef91089ba2488a74cccf30 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Mon, 9 Oct 2023 13:47:57 +1100 Subject: [PATCH 27/30] disable BRL api --- tests/unit/test_braille/test_brailleDisplayDrivers.py | 1 + 1 file changed, 1 insertion(+) 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 From e4824bef2f9a5d069517c41f8af11ba741e25b38 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 10 Oct 2023 09:26:53 +1100 Subject: [PATCH 28/30] fixup uiaccess for nvda_dmp --- source/setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/setup.py b/source/setup.py index f94b7a27528..c6e6369c781 100755 --- a/source/setup.py +++ b/source/setup.py @@ -160,9 +160,8 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: console=[ { "script": os.path.join("..", "include", "nvda_dmp", "nvda_dmp.py"), - "uiAccess": False, "icon_resources": [(1, "images/nvda.ico")], - "other_resources": [], + "other_resources": [_genManifestTemplate(shouldHaveUIAccess=False)], "version_info": { "version": formatBuildVersionString(), "description": "NVDA Diff-match-patch proxy", From d025aaf4104a6a06d47fea40ef55649e29eba4d9 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Tue, 10 Oct 2023 10:23:56 +1100 Subject: [PATCH 29/30] fix up CLI for setup py2exe --- sconstruct | 5 ++--- source/setup.py | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sconstruct b/sconstruct index 8b2e03ba905..ee7c5b12ae2 100755 --- a/sconstruct +++ b/sconstruct @@ -308,13 +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, "--dist-dir", target[0].abspath)) + buildCmd.append("setup.py") if env.get("uiAccess"): buildCmd.append("--enable-uiAccess") diff --git a/source/setup.py b/source/setup.py index c6e6369c781..cb51742a2de 100755 --- a/source/setup.py +++ b/source/setup.py @@ -52,9 +52,10 @@ def _parsePartialArguments() -> argparse.Namespace: "--enable-uiAccess", dest="uiAccess", action="store_true", - help="enable uiAccess for the main executable" + help="enable uiAccess for the main executable", + default=False, ) - partialArgs, _argslist = partialParser.parse_known_args(("--enable-uiAccess", )) + partialArgs, _argslist = partialParser.parse_known_args(sys.argv) return partialArgs @@ -173,6 +174,7 @@ def _genManifestTemplate(shouldHaveUIAccess: bool) -> tuple[int, int, bytes]: }, ], options={ + "verbose": 2, "optimize": 0, "bundle_files": 3, "dist_dir": "../dist", From afa0d928d56b4ef9be14aaccb67627393dd4a16c Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Wed, 11 Oct 2023 19:46:49 -0700 Subject: [PATCH 30/30] Add @codeofdusk attributions for Python 3.11 upgrade (#15609) Fix-up of #15513 #15514 . Description of how this pull request fixes the issue: Add @codeofdusk attributions for Python 3.11 upgrade --- user_docs/en/changes.t2t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index a9fb5e3782c..e9c89a4d8bf 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -45,8 +45,8 @@ Please open a GitHub issue if your Add-on has an issue with updating to the new - 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) - - fast_diff_match_patch to 2.0.1. (#15514) + - 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)