From 1a7b6d07d2a22a36ec1d5ccbaa255b7614618135 Mon Sep 17 00:00:00 2001 From: Nick Webster Date: Thu, 1 Aug 2024 10:04:53 +1200 Subject: [PATCH 1/2] Moving to Qt6 to support Python 3.9 to Python 3.12 --- README.md | 2 +- poetry.lock | 70 ++++++++++++++++++++++++++++++ pyproject.toml | 19 ++++++++ requirements.txt | 2 +- setup.py | 4 +- xdgprefs/__main__.py | 2 +- xdgprefs/gui/apps_panel.py | 2 +- xdgprefs/gui/association_item.py | 2 +- xdgprefs/gui/associations_panel.py | 2 +- xdgprefs/gui/custom_item.py | 6 +-- xdgprefs/gui/main_window.py | 2 +- xdgprefs/gui/mime_type_panel.py | 2 +- 12 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 poetry.lock create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 48c09ef..91305f1 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Directly reads the files that compose each of the following databases: This project only depends on * Python3.6 (should work with later versions) -* PySide2 (Qt5 for Python ; tested with version 5.9.0a1) +* PySide6 (Qt6 for Python) * configparser (Python standard library to read config files) * Uses code from https://github.com/wor/desktop_file_parser (in order to parse [Desktop files][apps-spec]) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..33136f4 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,70 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "pyside6" +version = "6.7.2" +description = "Python bindings for the Qt cross-platform application and UI framework" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "PySide6-6.7.2-cp39-abi3-macosx_11_0_universal2.whl", hash = "sha256:602debef9ec159b0db48f83b38a0e43e2dad3961f7d99f708d98620f04e9112b"}, + {file = "PySide6-6.7.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:15e7696a09072ee977f6e6179ab1e48184953df8417bcaa83cfadf0b79747242"}, + {file = "PySide6-6.7.2-cp39-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:6e0acb471535de303f56e3077aa86f53496b4de659b99ecce80520bcee508a63"}, + {file = "PySide6-6.7.2-cp39-abi3-win_amd64.whl", hash = "sha256:f73ae0de77d67f51ca3ce8207b12d3a5fa0107d3d5b6e4aeb3b53ee842b0927a"}, +] + +[package.dependencies] +PySide6-Addons = "6.7.2" +PySide6-Essentials = "6.7.2" +shiboken6 = "6.7.2" + +[[package]] +name = "pyside6-addons" +version = "6.7.2" +description = "Python bindings for the Qt cross-platform application and UI framework (Addons)" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "PySide6_Addons-6.7.2-cp39-abi3-macosx_11_0_universal2.whl", hash = "sha256:90b995efce61058d995c603ea480a9a3054fe8206739dcbc273fc3b53d40650f"}, + {file = "PySide6_Addons-6.7.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:94b9bf6a2a4a7ac671e1776633e50d51326c86f4184f1c6e556f4dd5498fd52a"}, + {file = "PySide6_Addons-6.7.2-cp39-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:22979b1aa09d9cf1d7a86c8a9aa0cb4791d6bd1cc94f96c5b6780c5ef8a9e34e"}, + {file = "PySide6_Addons-6.7.2-cp39-abi3-win_amd64.whl", hash = "sha256:ebf549eb25998665d8e4ec24014fbbd37bebc5ecdcb050b34db1e1c03e1bf81d"}, +] + +[package.dependencies] +PySide6-Essentials = "6.7.2" +shiboken6 = "6.7.2" + +[[package]] +name = "pyside6-essentials" +version = "6.7.2" +description = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "PySide6_Essentials-6.7.2-cp39-abi3-macosx_11_0_universal2.whl", hash = "sha256:4d13666e796ec140ecfb432c4f3d7baef6dfafc11929985a83b22c0025532fb7"}, + {file = "PySide6_Essentials-6.7.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a1a4c09f1e916b9cfe53151fe4a503a6acb1f6621ba28204d1bfe636f80d6780"}, + {file = "PySide6_Essentials-6.7.2-cp39-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:9135513e1c4c6e2fbb1e4f9afcb3d42e54708b0d9ed870cb3213ea4874cafa1e"}, + {file = "PySide6_Essentials-6.7.2-cp39-abi3-win_amd64.whl", hash = "sha256:0111d5fa8cf826de3ca9d82fed54726cce116d57f454f88a6467578652032d69"}, +] + +[package.dependencies] +shiboken6 = "6.7.2" + +[[package]] +name = "shiboken6" +version = "6.7.2" +description = "Python/C++ bindings helper module" +optional = false +python-versions = "<3.13,>=3.9" +files = [ + {file = "shiboken6-6.7.2-cp39-abi3-macosx_11_0_universal2.whl", hash = "sha256:50c33ac6317b673a1eb97a9abaafccb162c4ba0c9ca658a8e449c49a8aadc379"}, + {file = "shiboken6-6.7.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:70e80737b27cd5d83504b373013b55e70462bd4a27217d919ff9a83958731990"}, + {file = "shiboken6-6.7.2-cp39-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:98bedf9a15f1d8ba1af3e4d1e7527f7946ce36da541e08074fd9dc9ab5ff1adf"}, + {file = "shiboken6-6.7.2-cp39-abi3-win_amd64.whl", hash = "sha256:9024e6afb2af1568ebfc8a5d07e4ff6c8829f40923eeb28901f535463e2b6b65"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9, <3.13" +content-hash = "a1931ab186598c87929f29d868530a11cab0d58d0246c71bc39097370977822c" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..01f93d0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[tool.poetry] +name = "XDG-Prefs" +version = "0.3.0" +description = "A GUI program to view and change your default programs preferences (which program should open which type of file), using the XDG Specifications" +authors = ["Remy Chaput "] +license = "Apache" +readme = "README.md" +packages = [{include = "xdgprefs"}] + +[tool.poetry.dependencies] +python = "^3.9, <3.13" +PySide6 = "^6.7" + + +[build-system] +requires = [ + "setuptools >= 40.9.0", +] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index ab9e044..9137a62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyside2 +pyside6 diff --git a/setup.py b/setup.py index 1bdd679..ad894d7 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,10 @@ def read(fname): setup( name='XDG-Prefs', - version='0.2', + version='0.3', packages=['xdgprefs', 'xdgprefs.core', 'xdgprefs.gui'], - install_requires=['PySide2'], + install_requires=['PySide6'], entry_points={ 'gui_scripts': [ diff --git a/xdgprefs/__main__.py b/xdgprefs/__main__.py index c1c89fb..b90b49c 100644 --- a/xdgprefs/__main__.py +++ b/xdgprefs/__main__.py @@ -4,7 +4,7 @@ import sys -from PySide2.QtWidgets import QApplication +from PySide6.QtWidgets import QApplication from xdgprefs.gui.main_window import MainWindow diff --git a/xdgprefs/gui/apps_panel.py b/xdgprefs/gui/apps_panel.py index c89da33..ef88746 100644 --- a/xdgprefs/gui/apps_panel.py +++ b/xdgprefs/gui/apps_panel.py @@ -4,7 +4,7 @@ """ -from PySide2.QtWidgets import QListWidget, QWidget, \ +from PySide6.QtWidgets import QListWidget, QWidget, \ QLabel, QGridLayout, QLineEdit, QCheckBox from xdgprefs.core import DesktopEntry diff --git a/xdgprefs/gui/association_item.py b/xdgprefs/gui/association_item.py index 57dd9ed..edc9e3b 100644 --- a/xdgprefs/gui/association_item.py +++ b/xdgprefs/gui/association_item.py @@ -5,7 +5,7 @@ from threading import Thread -from PySide2.QtWidgets import QComboBox +from PySide6.QtWidgets import QComboBox from xdgprefs.gui.mime_item import MimeTypeItem diff --git a/xdgprefs/gui/associations_panel.py b/xdgprefs/gui/associations_panel.py index 86d37d4..0d69cf9 100644 --- a/xdgprefs/gui/associations_panel.py +++ b/xdgprefs/gui/associations_panel.py @@ -5,7 +5,7 @@ """ -from PySide2.QtWidgets import QListWidget, QWidget, \ +from PySide6.QtWidgets import QListWidget, QWidget, \ QLabel, QCheckBox, QLineEdit, QGridLayout from xdgprefs.core import MimeType diff --git a/xdgprefs/gui/custom_item.py b/xdgprefs/gui/custom_item.py index 81e2ca6..a250fa6 100644 --- a/xdgprefs/gui/custom_item.py +++ b/xdgprefs/gui/custom_item.py @@ -8,10 +8,10 @@ """ -from PySide2.QtWidgets import QListWidgetItem, QWidget, \ +from PySide6.QtWidgets import QListWidgetItem, QWidget, \ QVBoxLayout, QHBoxLayout, QLabel -from PySide2.QtGui import QPixmap -from PySide2.QtCore import QSize +from PySide6.QtGui import QPixmap +from PySide6.QtCore import QSize class CustomItem(QListWidgetItem): diff --git a/xdgprefs/gui/main_window.py b/xdgprefs/gui/main_window.py index 008bdab..2bcbefa 100644 --- a/xdgprefs/gui/main_window.py +++ b/xdgprefs/gui/main_window.py @@ -4,7 +4,7 @@ """ -from PySide2.QtWidgets import QMainWindow, QTabWidget +from PySide6.QtWidgets import QMainWindow, QTabWidget from xdgprefs.gui import MimeTypePanel, AppsPanel, AssociationsPanel from xdgprefs.core import MimeDatabase, AppDatabase, AssociationsDatabase diff --git a/xdgprefs/gui/mime_type_panel.py b/xdgprefs/gui/mime_type_panel.py index e34fddd..729ab2c 100644 --- a/xdgprefs/gui/mime_type_panel.py +++ b/xdgprefs/gui/mime_type_panel.py @@ -4,7 +4,7 @@ """ -from PySide2.QtWidgets import QListWidget, QWidget, QLabel, QGridLayout, \ +from PySide6.QtWidgets import QListWidget, QWidget, QLabel, QGridLayout, \ QLineEdit, QCheckBox from xdgprefs.core import MimeType From 45cd270137ee6a92e97ee13a501aaaf2773c851e Mon Sep 17 00:00:00 2001 From: Nick Webster Date: Thu, 1 Aug 2024 20:20:08 +1200 Subject: [PATCH 2/2] Updating the classifier because Python 3.9 is the new minimum supported version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ad894d7..763490a 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def read(fname): 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: Unix', - 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.9', 'Topic :: Utilities' ] )