Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Python 3.11 #15544

Merged
merged 33 commits into from
Oct 16, 2023
Merged

Update to Python 3.11 #15544

merged 33 commits into from
Oct 16, 2023

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Sep 28, 2023

Link to issue number:

Closes #12064
Closes #12551
Closes #15577
Closes #15167

Summary of the issue:

Python needs to be updated to 3.11, as Python 3.7 is EOL.
Python pip dependencies need to be updated to match the python upgrade.
typing_extensions is no longer needed.

Description of user facing changes

Performance and security enhancements from dependency upgrades.

Description of development approach

  • Updates python in build scripts
  • Updates pip dependencies
  • Set Windows 8.1 (Blue) as minimum windows version
  • Update references to python and windows version in docs
  • nose is replaced by the unittest module with xmlrunner to generate XML test output
  • drop python optimization to level 0 from level 1. level 1 removes asserts.

Testing strategy:

Alpha testing required

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@seanbudd seanbudd mentioned this pull request Sep 28, 2023
5 tasks
@codeofdusk

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

@seanbudd

This comment was marked as resolved.

@seanbudd seanbudd marked this pull request as draft September 28, 2023 03:25
user_docs/en/changes.t2t Outdated Show resolved Hide resolved
Copy link
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really love to see this flying!
Before this is merged, I'd like to suggest changing the launcher nsis script so that it has Windows 8.1 as the minimum required version as well.

requirements.txt Outdated Show resolved Hide resolved
nvdaHelper/readme.md Show resolved Hide resolved
@AppVeyorBot

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

requirements.txt Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
source/setup.py Show resolved Hide resolved
user_docs/en/userGuide.t2t Outdated Show resolved Hide resolved
@seanbudd
Copy link
Member Author

Hi all, this is still a draft PR

@seanbudd
Copy link
Member Author

seanbudd commented Oct 2, 2023

Before this is merged, I'd like to suggest changing the launcher nsis script so that it has Windows 8.1 as the minimum required version as well.

@LeonarddeR

As far as I am aware nvdaLauncher.nsi doesn't check Windows versions

@AppVeyorBot

This comment was marked as resolved.

@codeofdusk
Copy link
Contributor

codeofdusk commented Oct 10, 2023

I've been running this for a while with almost no issues!

Intermitantly, when copying text to the clipboard in Chrome, I get:

Traceback (most recent call last):
  File "api.pyc", line 394, in copyToClip
  File "api.pyc", line 415, in getClipData
  File "contextlib.pyc", line 137, in __enter__
  File "winUser.pyc", line 812, in openClipboard
PermissionError: [WinError 5] Access is denied.

@LeonarddeR
Copy link
Collaborator

@seanbudd Would it be possible to provide a signed try build?

@seanbudd seanbudd marked this pull request as draft October 12, 2023 02:26
Fix-up of #15513 #15514 .

Description of how this pull request fixes the issue:
Add @codeofdusk attributions for Python 3.11 upgrade
@seanbudd
Copy link
Member Author

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Oct 12, 2023

Thanks for the try build @seanbudd
From my first observations, all seems to work smoothly. That said, it looks like the garbage handler kicks in more often with errors like this:

Log snipped WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Garbage collector has found one or more unreachable objects. See further warnings for specific objects. Stack trace: File "nvda.pyw", line 399, in File "core.pyc", line 813, in main File "wx\core.pyc", line 2262, in MainLoop File "wx\core.pyc", line 3427, in File "core.pyc", line 746, in processRequest File "core.pyc", line 762, in Notify File "queueHandler.pyc", line 97, in pumpAll File "queueHandler.pyc", line 64, in flushQueue File "eventHandler.pyc", line 84, in _queueEventCallback File "eventHandler.pyc", line 322, in executeEvent File "eventHandler.pyc", line 355, in doPreGainFocus File "api.pyc", line 163, in setFocusObject File "treeInterceptorHandler.pyc", line 50, in update File "NVDAObjects\__init__.pyc", line 430, in _get_treeInterceptor File "treeInterceptorHandler.pyc", line 42, in getTreeInterceptor File "NVDAObjects\IAccessible\chromium.pyc", line 84, in __contains__ File "comtypes\_memberspec.pyc", line 482, in __call__ File "comtypes\client\__init__.pyc", line 47, in wrap_outparam File "comtypes\client\__init__.pyc", line 100, in GetBestInterface File "comtypes\client\dynamic.pyc", line 29, in Dispatch File "comtypes\automation.pyc", line 776, in GetTypeInfo File "monkeyPatches\comtypesMonkeyPatches.pyc", line 157, in newGetTypeInfo File "monkeyPatches\comtypesMonkeyPatches.pyc", line 31, in __call__ File "monkeyPatches\comtypesMonkeyPatches.pyc", line 128, in newCpbDel File "garbageHandler.pyc", line 67, in notifyObjectDeletion WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object ERROR - garbageHandler._collectionCallback (08:34:36.119) - MainThread (17080): Found at least 40 unreachable objects in run

This was observed when arrowing through the list of chats in Teams 2.0.

I think we need to investigate what changes happend to garbage collection. It somehow looks like newer Python 3 is better in detecting abandoned objects itself.

@seanbudd
Copy link
Member Author

@LeonarddeR @codeofdusk - these minor issues will have to be handled in a separate issue/PR, once this has been merged

@seanbudd seanbudd marked this pull request as ready for review October 15, 2023 22:44
Copy link
Member

@michaelDCurran michaelDCurran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to get maximum testing, I would recommend merging this sooner than later, acknowledging though that brlTTY support is currently not functional and a fix may still be some time away. We should not however branch for beta until a new brlAPI module compatible with Python 3.11 is available of course.

@seanbudd seanbudd removed the blocked label Oct 16, 2023
@seanbudd seanbudd merged commit 01f3e1e into master Oct 16, 2023
@seanbudd seanbudd deleted the py311-min branch October 16, 2023 02:50
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Oct 16, 2023
seanbudd added a commit that referenced this pull request Oct 18, 2023
Clean up of #15544

Summary of the issue:
from __future__ import annotations can be removed
gettext now supports pgettext and npgettext, NVDA's implementations can be abandoned
enum patches can be removed Remove enum patches on Python 3.11 #15531
Description of user facing changes
Should be none

Description of development approach
Straight forward code deprecation or implementation of noted comments
@LeonarddeR LeonarddeR mentioned this pull request Oct 20, 2023
5 tasks
seanbudd pushed a commit that referenced this pull request Oct 22, 2023
Follow up of #15544

Summary of the issue:
In #15544, support for the ease of access proxy for Windows 7 was removed, but there was still some remaining code for Windows 7 to set start after logon using a run key.

Description of user facing changes
None.

Description of development approach
Remove windows 7 support.
seanbudd pushed a commit that referenced this pull request Oct 26, 2023
Fixes #15652
See also nvaccess/nvda-misc-deps#28

Summary of the issue:
BRLTTY support was temporarily acknowledged as broken as part of #15544.

Description of user facing changes
None

Description of development approach
Update misc deps
Re-enable the brlapi test
Testing strategy:
Execute scons dist and run the generated NVDA distribution. Execute import brlapi from the Python Console.
@seanbudd seanbudd mentioned this pull request Jan 23, 2024
seanbudd added a commit that referenced this pull request Jan 23, 2024
Reported by dependabot: https://github.com/nvaccess/nvda/security/dependabot/2

Pillow < 10.2.0 has a known security issue
This PR bumps the Pillow version

Note Pillow was introduced as a pinned implicit dependency as part of #15544
seanbudd added a commit that referenced this pull request Feb 28, 2024
Fix up of #15544

Summary of the issue:
#15544 changed our compiler flag to raise exceptions if an assert statement fails.
This slows down NVDA (having to check exceptions) and adds risk to final releases.
This lead to #16212 being discovered

Description of user facing changes
Assertions should be ignored in builds

Description of development approach
Restored optimize level to 1
https://docs.python.org/3.11/tutorial/modules.html#compiled-python-files
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
Reported by dependabot: https://github.com/nvaccess/nvda/security/dependabot/2

Pillow < 10.2.0 has a known security issue
This PR bumps the Pillow version

Note Pillow was introduced as a pinned implicit dependency as part of nvaccess#15544
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
Fix up of nvaccess#15544

Summary of the issue:
nvaccess#15544 changed our compiler flag to raise exceptions if an assert statement fails.
This slows down NVDA (having to check exceptions) and adds risk to final releases.
This lead to nvaccess#16212 being discovered

Description of user facing changes
Assertions should be ignored in builds

Description of development approach
Restored optimize level to 1
https://docs.python.org/3.11/tutorial/modules.html#compiled-python-files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants