From 851124e863b1bf39d91aaa855a5fb8e0955f0063 Mon Sep 17 00:00:00 2001 From: Guthrie McAfee Armstrong Date: Tue, 31 May 2022 17:04:01 -0400 Subject: [PATCH] Upgrade from PySide2 (Qt 5) to PySide6 (Qt 6) PySide6 prebuilt binaries have support a wider range of CPU architectures (namely Apple Silicon/M1). --- dangerzone/gui/__init__.py | 5 +---- dangerzone/gui/common.py | 2 +- dangerzone/gui/main_window.py | 2 +- dangerzone/gui/systray.py | 2 +- poetry.lock | 38 +++++++++++++++-------------------- pyproject.toml | 2 +- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/dangerzone/gui/__init__.py b/dangerzone/gui/__init__.py index 721725a..4d98468 100644 --- a/dangerzone/gui/__init__.py +++ b/dangerzone/gui/__init__.py @@ -4,7 +4,7 @@ import signal import platform import click import uuid -from PySide2 import QtCore, QtWidgets +from PySide6 import QtCore, QtWidgets from .common import GuiCommon from .main_window import MainWindow @@ -46,9 +46,6 @@ class ApplicationWrapper(QtCore.QObject): @click.argument("filename", required=False) def gui_main(filename): if platform.system() == "Darwin": - # Required for macOS Big Sur: https://stackoverflow.com/a/64878899 - os.environ["QT_MAC_WANTS_LAYER"] = "1" - # Make sure /usr/local/bin is in the path os.environ["PATH"] = "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" diff --git a/dangerzone/gui/common.py b/dangerzone/gui/common.py index aa478f8..9fc5f84 100644 --- a/dangerzone/gui/common.py +++ b/dangerzone/gui/common.py @@ -3,7 +3,7 @@ import platform import subprocess import shlex import pipes -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from colorama import Fore if platform.system() == "Darwin": diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index fac3909..0222c82 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -4,7 +4,7 @@ import tempfile import subprocess import json import shutil -from PySide2 import QtCore, QtGui, QtWidgets +from PySide6 import QtCore, QtGui, QtWidgets from colorama import Style, Fore from ..common import Common diff --git a/dangerzone/gui/systray.py b/dangerzone/gui/systray.py index c5ad8c1..882b0f6 100644 --- a/dangerzone/gui/systray.py +++ b/dangerzone/gui/systray.py @@ -1,5 +1,5 @@ import platform -from PySide2 import QtWidgets +from PySide6 import QtWidgets class SysTray(QtWidgets.QSystemTrayIcon): diff --git a/poetry.lock b/poetry.lock index d2978c5..bb634c7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -207,15 +207,15 @@ optional = false python-versions = ">=3.7" [[package]] -name = "pyside2" -version = "5.15.2.1" +name = "pyside6" +version = "6.2.4" description = "Python bindings for the Qt cross-platform application and UI framework" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.11" +python-versions = ">=3.6, <3.11" [package.dependencies] -shiboken2 = "5.15.2.1" +shiboken6 = "6.2.4" [[package]] name = "pywin32" @@ -252,12 +252,12 @@ socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] [[package]] -name = "shiboken2" -version = "5.15.2.1" +name = "shiboken6" +version = "6.2.4" description = "Python / C++ bindings helper module" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.11" +python-versions = ">=3.6, <3.11" [[package]] name = "strip-ansi" @@ -345,7 +345,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = ">=3.7,<3.11" -content-hash = "fc18f36198c3f56ae4470b7d99759ae9d46f42deb90c4606ac2688fbdec75e89" +content-hash = "e90cfa70e7a6f0df277cb8d8a5eccdf10c65c26f21b51e46d4d98dcd2a17f712" [metadata.files] altgraph = [ @@ -526,13 +526,10 @@ pyinstaller-hooks-contrib = [ {file = "pyinstaller-hooks-contrib-2022.6.tar.gz", hash = "sha256:9dc611cf6667301e95384b4a0631b032bbffa16a0688f4cfa014d0c1e751d276"}, {file = "pyinstaller_hooks_contrib-2022.6-py2.py3-none-any.whl", hash = "sha256:e38bf9266c57be19647762ee63b012683beb6919c6bc2ecdc66ca174edec44a0"}, ] -pyside2 = [ - {file = "PySide2-5.15.2.1-5.15.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:b5e1d92f26b0bbaefff67727ccbb2e1b577f2c0164b349b3d6e80febb4c5bde2"}, - {file = "PySide2-5.15.2.1-5.15.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:235240b6ec8206d9fdf0232472c6ef3241783d480425e5b54796f06e39ed23da"}, - {file = "PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_13_intel.whl", hash = "sha256:a9e2e6bbcb5d2ebb421e46e72244a0f4fe0943b2288115f80a863aacc1de1f06"}, - {file = "PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl", hash = "sha256:23886c6391ebd916e835fa1b5ae66938048504fd3a2934ae3189a96cd5ac0b46"}, - {file = "PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-none-win32.whl", hash = "sha256:439509e53cfe05abbf9a99422a2cbad086408b0f9bf5e6f642ff1b13b1f8b055"}, - {file = "PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-none-win_amd64.whl", hash = "sha256:af6b263fe63ba6dea7eaebae80aa7b291491fe66f4f0057c0aafe780cc83da9d"}, +pyside6 = [ + {file = "PySide6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_14_universal2.whl", hash = "sha256:d18f4d5ad2d4921dbb47166d3fce11a2eca1c83b670e210f983d60871d2e6bdb"}, + {file = "PySide6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl", hash = "sha256:4656853a34bea096bb0a1f74e22607f99cca6e68d55a4f86a73770c5ec74565e"}, + {file = "PySide6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-none-win_amd64.whl", hash = "sha256:5e79a476fe05f303c1aadf6be7d31c486e6064319393ad1519f1f3f114296571"}, ] pywin32 = [ {file = "pywin32-304-cp310-cp310-win32.whl", hash = "sha256:3c7bacf5e24298c86314f03fa20e16558a4e4138fc34615d7de4070c23e65af3"}, @@ -558,13 +555,10 @@ requests = [ {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, ] -shiboken2 = [ - {file = "shiboken2-5.15.2.1-5.15.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:f890f5611ab8f48b88cfecb716da2ac55aef99e2923198cefcf781842888ea65"}, - {file = "shiboken2-5.15.2.1-5.15.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:87079c07587859a525b9800d60b1be971338ce9b371d6ead81f15ee5a46d448b"}, - {file = "shiboken2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_13_intel.whl", hash = "sha256:ffd3d0ec3d508e592d7ee3885d27fee1f279a49989f734eb130f46d9501273a9"}, - {file = "shiboken2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl", hash = "sha256:63debfcc531b6a2b4985aa9b71433d2ad3bac542acffc729cc0ecaa3854390c0"}, - {file = "shiboken2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-none-win32.whl", hash = "sha256:eb0da44b6fa60c6bd317b8f219e500595e94e0322b33ec5b4e9f406bedaee555"}, - {file = "shiboken2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-none-win_amd64.whl", hash = "sha256:a0d0fdeb12b72c8af349b9642ccc67afd783dca449309f45e78cda50272fd6b7"}, +shiboken6 = [ + {file = "shiboken6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_14_universal2.whl", hash = "sha256:5030b6314ef504cc5d93d272aaef4e0ccb256324caa2de965c88d32c994d98b2"}, + {file = "shiboken6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl", hash = "sha256:05f4652dda7043b1a04265cabc1709c22d643d204fac2c4b0ccf7d0044092c62"}, + {file = "shiboken6-6.2.4-6.2.4-cp36.cp37.cp38.cp39.cp310-none-win_amd64.whl", hash = "sha256:8eb2ed2ba8ec3f6505cf80b81c7e85d996165a9e4664f99675ecc8a82b7b3c36"}, ] strip-ansi = [ {file = "strip-ansi-0.1.1.tar.gz", hash = "sha256:5d60f239cc8a37fdd52b43c3e66e893d45ba0423115db59eca0d2eef83b07729"}, diff --git a/pyproject.toml b/pyproject.toml index a00ff9a..e9d713e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ appdirs = "*" requests = "*" macholib = "*" termcolor = "*" -PySide2 = "5.15.2.1" +PySide6 = "6.2.*" # 6.2 is LTS colorama = "*" psutil = "*" cx_freeze = {version = "*", platform = "win32"}