From a5ab74d44e9b0165e81d883b7d20ef678784f84e Mon Sep 17 00:00:00 2001 From: Elias Mueller Date: Tue, 25 Nov 2025 22:09:28 +0100 Subject: [PATCH 1/3] build(deps): bump dependencies --- pyproject.toml | 5 +++-- uv.lock | 46 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 527b35f..88de9eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,16 +11,17 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Private :: Do Not Upload", ] dependencies = [ - "pyside6-essentials==6.10.0", + "pyside6-essentials==6.10.1", "pywin32>=311; sys_platform == 'win32'", ] [dependency-groups] dev = [ - "pytest>=8.4.2", + "pytest>=9.0.1", ] [project.urls] diff --git a/uv.lock b/uv.lock index 0dcefd3..eb78f2a 100644 --- a/uv.lock +++ b/uv.lock @@ -13,23 +13,23 @@ wheels = [ [[package]] name = "exceptiongroup" -version = "1.3.0" +version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" } +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674, upload-time = "2025-05-10T17:42:49.33Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, ] [[package]] name = "iniconfig" -version = "2.1.0" +version = "2.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] [[package]] @@ -61,17 +61,17 @@ wheels = [ [[package]] name = "pyside6-essentials" -version = "6.10.0" +version = "6.10.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "shiboken6" }, ] wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/55/bad02ab890c8b8101abef0db4a2e5304be78a69e23a438e4d8555b664467/pyside6_essentials-6.10.0-cp39-abi3-macosx_13_0_universal2.whl", hash = "sha256:003e871effe1f3e5b876bde715c15a780d876682005a6e989d89f48b8b93e93a", size = 105034090, upload-time = "2025-10-08T09:48:24.944Z" }, - { url = "https://files.pythonhosted.org/packages/5c/75/e17efc7eb900993e0e3925885635c6cf373c817196f09bcbcc102b00ac94/pyside6_essentials-6.10.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:1d5e013a8698e37ab8ef360e6960794eb5ef20832a8d562e649b8c5a0574b2d8", size = 76362150, upload-time = "2025-10-08T09:48:31.849Z" }, - { url = "https://files.pythonhosted.org/packages/06/62/fbd1e81caafcda97b147c03f5b06cfaadd8da5fa8298f527d2ec648fa5b7/pyside6_essentials-6.10.0-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:b1dd0864f0577a448fb44426b91cafff7ee7cccd1782ba66491e1c668033f998", size = 75454169, upload-time = "2025-10-08T09:48:38.21Z" }, - { url = "https://files.pythonhosted.org/packages/bb/3a/d8211d17e6ca70f641c6ebd309f08ef18930acda60e74082c75875a274da/pyside6_essentials-6.10.0-cp39-abi3-win_amd64.whl", hash = "sha256:fc167eb211dd1580e20ba90d299e74898e7a5a1306d832421e879641fc03b6fe", size = 74361794, upload-time = "2025-10-08T09:48:44.335Z" }, - { url = "https://files.pythonhosted.org/packages/61/e9/0e22e3c10325c4ff09447fadb43f7962afb82cef0b65358f5704251c6b32/pyside6_essentials-6.10.0-cp39-abi3-win_arm64.whl", hash = "sha256:6dd0936394cb14da2fd8e869899f5e0925a738b1c8d74c2f22503720ea363fb1", size = 55099467, upload-time = "2025-10-08T09:48:50.902Z" }, + { url = "https://files.pythonhosted.org/packages/04/b0/c43209fecef79912e9b1c70a1b5172b1edf76caebcc885c58c60a09613b0/pyside6_essentials-6.10.1-cp39-abi3-macosx_13_0_universal2.whl", hash = "sha256:cd224aff3bb26ff1fca32c050e1c4d0bd9f951a96219d40d5f3d0128485b0bbe", size = 105461499, upload-time = "2025-11-20T09:59:23.733Z" }, + { url = "https://files.pythonhosted.org/packages/5f/8e/b69ba7fa0c701f3f4136b50460441697ec49ee6ea35c229eb2a5ee4b5952/pyside6_essentials-6.10.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:e9ccbfb58c03911a0bce1f2198605b02d4b5ca6276bfc0cbcf7c6f6393ffb856", size = 76764617, upload-time = "2025-11-20T09:59:38.831Z" }, + { url = "https://files.pythonhosted.org/packages/bd/83/569d27f4b6c6b9377150fe1a3745d64d02614021bea233636bc936a23423/pyside6_essentials-6.10.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:ec8617c9b143b0c19ba1cc5a7e98c538e4143795480cb152aee47802c18dc5d2", size = 75850373, upload-time = "2025-11-20T09:59:56.082Z" }, + { url = "https://files.pythonhosted.org/packages/1e/64/a8df6333de8ccbf3a320e1346ca30d0f314840aff5e3db9b4b66bf38e26c/pyside6_essentials-6.10.1-cp39-abi3-win_amd64.whl", hash = "sha256:9555a48e8f0acf63fc6a23c250808db841b28a66ed6ad89ee0e4df7628752674", size = 74491180, upload-time = "2025-11-20T10:00:11.215Z" }, + { url = "https://files.pythonhosted.org/packages/67/da/65cc6c6a870d4ea908c59b2f0f9e2cf3bfc6c0710ebf278ed72f69865e4e/pyside6_essentials-6.10.1-cp39-abi3-win_arm64.whl", hash = "sha256:4d1d248644f1778f8ddae5da714ca0f5a150a5e6f602af2765a7d21b876da05c", size = 55190458, upload-time = "2025-11-20T10:00:26.226Z" }, ] [[package]] @@ -90,16 +90,16 @@ dev = [ [package.metadata] requires-dist = [ - { name = "pyside6-essentials", specifier = "==6.10.0" }, + { name = "pyside6-essentials", specifier = "==6.10.1" }, { name = "pywin32", marker = "sys_platform == 'win32'", specifier = ">=311" }, ] [package.metadata.requires-dev] -dev = [{ name = "pytest", specifier = ">=8.4.2" }] +dev = [{ name = "pytest", specifier = ">=9.0.1" }] [[package]] name = "pytest" -version = "8.4.2" +version = "9.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, @@ -110,9 +110,9 @@ dependencies = [ { name = "pygments" }, { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, + { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, ] [[package]] @@ -139,14 +139,14 @@ wheels = [ [[package]] name = "shiboken6" -version = "6.10.0" +version = "6.10.1" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fd/78/3e730aea82089dd82b1e092bc265778bda329459e6ad9b7134eec5fff3f2/shiboken6-6.10.0-cp39-abi3-macosx_13_0_universal2.whl", hash = "sha256:7a5f5f400ebfb3a13616030815708289c2154e701a60b9db7833b843e0bee543", size = 476535, upload-time = "2025-10-08T09:49:08Z" }, - { url = "https://files.pythonhosted.org/packages/ea/09/4ffa3284a17b6b765d45b41c9a7f1b2cde6c617c853ac6f170fb62bbbece/shiboken6-6.10.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:e612734da515d683696980107cdc0396a3ae0f07b059f0f422ec8a2333810234", size = 271098, upload-time = "2025-10-08T09:49:09.47Z" }, - { url = "https://files.pythonhosted.org/packages/31/29/00e26f33a0fb259c2edce9c761a7a438d7531ca514bdb1a4c072673bd437/shiboken6-6.10.0-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:b01377e68d14132360efb0f4b7233006d26aa8ae9bb50edf00960c2a5f52d148", size = 267698, upload-time = "2025-10-08T09:49:10.694Z" }, - { url = "https://files.pythonhosted.org/packages/11/30/e4624a7e3f0dc9796b701079b77defcce0d32d1afc86bb1d0df04bc3d9e2/shiboken6-6.10.0-cp39-abi3-win_amd64.whl", hash = "sha256:0bc5631c1bf150cbef768a17f5f289aae1cb4db6c6b0c19b2421394e27783717", size = 1234227, upload-time = "2025-10-08T09:49:12.774Z" }, - { url = "https://files.pythonhosted.org/packages/dd/e5/0ab862005ea87dc8647ba958a3099b3b0115fd6491c65da5c5a0f6364db1/shiboken6-6.10.0-cp39-abi3-win_arm64.whl", hash = "sha256:dfc4beab5fec7dbbebbb418f3bf99af865d6953aa0795435563d4cbb82093b61", size = 1794775, upload-time = "2025-10-08T09:49:14.641Z" }, + { url = "https://files.pythonhosted.org/packages/6f/8b/e5db743d505ceea3efc4cd9634a3bee22a3e2bf6e07cefd28c9b9edabcc6/shiboken6-6.10.1-cp39-abi3-macosx_13_0_universal2.whl", hash = "sha256:9f2990f5b61b0b68ecadcd896ab4441f2cb097eef7797ecc40584107d9850d71", size = 478483, upload-time = "2025-11-20T10:08:52.411Z" }, + { url = "https://files.pythonhosted.org/packages/56/ba/b50c1a44b3c4643f482afbf1a0ea58f393827307100389ce29404f9ad3b0/shiboken6-6.10.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:f4221a52dfb81f24a0d20cc4f8981cb6edd810d5a9fb28287ce10d342573a0e4", size = 271993, upload-time = "2025-11-20T10:08:54.093Z" }, + { url = "https://files.pythonhosted.org/packages/16/b8/939c24ebd662b0aa5c945443d0973145b3fb7079f0196274ef7bb4b98f73/shiboken6-6.10.1-cp39-abi3-manylinux_2_39_aarch64.whl", hash = "sha256:c095b00f4d6bf578c0b2464bb4e264b351a99345374478570f69e2e679a2a1d0", size = 268691, upload-time = "2025-11-20T10:08:55.639Z" }, + { url = "https://files.pythonhosted.org/packages/cf/a6/8c65ee0fa5e172ebcca03246b1bc3bd96cdaf1d60537316648536b7072a5/shiboken6-6.10.1-cp39-abi3-win_amd64.whl", hash = "sha256:c1601d3cda1fa32779b141663873741b54e797cb0328458d7466281f117b0a4e", size = 1234704, upload-time = "2025-11-20T10:08:57.417Z" }, + { url = "https://files.pythonhosted.org/packages/7b/6a/c0fea2f2ac7d9d96618c98156500683a4d1f93fea0e8c5a2bc39913d7ef1/shiboken6-6.10.1-cp39-abi3-win_arm64.whl", hash = "sha256:5cf800917008587b551005a45add2d485cca66f5f7ecd5b320e9954e40448cc9", size = 1795567, upload-time = "2025-11-20T10:08:59.184Z" }, ] [[package]] From e9684cd829e68b3a510f150281f31e58101ecba2 Mon Sep 17 00:00:00 2001 From: Elias Mueller Date: Tue, 25 Nov 2025 22:17:28 +0100 Subject: [PATCH 2/3] refactor: use functions for startup sequence --- src/startup.py | 58 ++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/src/startup.py b/src/startup.py index 62230f1..8c3aebb 100644 --- a/src/startup.py +++ b/src/startup.py @@ -6,45 +6,39 @@ import sys -class StartUp: +def perform_startup(): + configure_qt_application_data() + configure_environment_variables() + import_bindings() + start_application() - @staticmethod - def configure_qt_application_data(): - from PySide6.QtCore import QCoreApplication - QCoreApplication.setApplicationName("my app name") - QCoreApplication.setOrganizationName("my org name") - QCoreApplication.setApplicationVersion("my app version") - @staticmethod - def configure_environment_variables(): - # Qt expects "qtquickcontrols2.conf" at root level, but the way we handle resources does not allow that. - # So we need to override the path here - os.environ["QT_QUICK_CONTROLS_CONF"] = ":/data/qtquickcontrols2.conf" +def configure_qt_application_data(): + from PySide6.QtCore import QCoreApplication + QCoreApplication.setApplicationName("my app name") + QCoreApplication.setOrganizationName("my org name") + QCoreApplication.setApplicationVersion("my app version") - @staticmethod - def import_bindings(): - import src.viewmodels # noqa: F401 - @staticmethod - def start_application(): - from src.application import MyApplication - app = MyApplication(sys.argv) +def configure_environment_variables(): + # Qt expects "qtquickcontrols2.conf" at root level, but the way we handle resources does not allow that. + # So we need to override the path here + os.environ["QT_QUICK_CONTROLS_CONF"] = ":/data/qtquickcontrols2.conf" - app.set_window_icon() - app.set_up_signals() - app.set_up_window_event_filter() - app.start_engine() - app.set_up_window_effects() - app.verify() - sys.exit(app.exec()) +def import_bindings(): + import src.viewmodels # noqa: F401 -def perform_startup(): - we = StartUp() +def start_application(): + from src.application import MyApplication + app = MyApplication(sys.argv) - we.configure_qt_application_data() - we.configure_environment_variables() - we.import_bindings() + app.set_window_icon() + app.set_up_signals() + app.set_up_window_event_filter() + app.start_engine() + app.set_up_window_effects() + app.verify() - we.start_application() + sys.exit(app.exec()) From d99e5fc401d061d1967f5aab8cd18db8c5f7edda Mon Sep 17 00:00:00 2001 From: Elias Mueller Date: Tue, 25 Nov 2025 22:19:57 +0100 Subject: [PATCH 3/3] test: run QML tests with Python --- .github/workflows/build.yml | 21 +++++++++++++-------- Justfile | 29 +++++++++++++++++++++++------ test/prepare_qml.py | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 test/prepare_qml.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00658af..e062a68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,17 +92,22 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Qt 6.10.* - uses: jurplel/install-qt-action@v4 + - name: Install Python 3.13 + uses: actions/setup-python@v6 with: - arch: linux_gcc_64 - version: 6.10.* - - name: Update Packages - run: sudo apt update -y && sudo apt upgrade -y - - name: Install Dependencies - run: sudo apt install -y qt6-base-dev + python-version: "3.13" - name: Install just uses: taiki-e/install-action@just + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: false + - name: Update Packages + run: sudo apt update -y + - name: Install Dependencies + run: sudo apt install -y libegl1 + - name: Initialize Project + run: just init - name: Execute Qml Tests run: just test-qml diff --git a/Justfile b/Justfile index 0ee977e..4697526 100644 --- a/Justfile +++ b/Justfile @@ -30,9 +30,9 @@ export QT_QUICK_CONTROLS_STYLE := 'Material' # Remove ALL generated files [group('build')] -@clean: _update_pyproject_file - uv run pyside6-project clean - rm -rf build test/rc_project.py project.json project.qrc +@clean: + find i18n -name "*.qm" -type f -delete + rm -rf build pyobjects test/rc_project.py rc_project.py project.json project.qrc # Add language; pattern: language-region ISO 639-1, ISO 3166-1; example: fr-FR [group('i18n')] @@ -51,15 +51,32 @@ export QT_QUICK_CONTROLS_STYLE := 'Material' # Run Python tests [group('test')] -@test-python: build-develop +@test-python: _prepare-tests rm -f test/rc_project.py cp rc_project.py test/rc_project.py uv run pytest build-aux test # Run QML tests [group('test')] -@test-qml: - qmltestrunner -silent -input qt/qml +test-qml: _prepare-tests + #!/usr/bin/env bash + uv run python -c ' + import sys + from PySide6.QtQuickTest import QUICK_TEST_MAIN_WITH_SETUP + from test.prepare_qml import MyTestSetup + + # Pass additional arguments to qmltestrunner: + sys.argv += ["-silent"] + sys.argv += ["-input", "qt/qml"] + # sys.argv += ["-eventdelay", "50"] # Simulate slower systems + + ex = QUICK_TEST_MAIN_WITH_SETUP("qmltestrunner", MyTestSetup, argv=sys.argv) + sys.exit(ex) + ' + +@_prepare-tests: build-develop + rm -f test/rc_project.py + cp rc_project.py test/rc_project.py @_update_pyproject_file: _generate-qrc-file uv run python build-aux/update_pyproject_file.py \ diff --git a/test/prepare_qml.py b/test/prepare_qml.py new file mode 100644 index 0000000..054596c --- /dev/null +++ b/test/prepare_qml.py @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: mpvQC developers +# +# SPDX-License-Identifier: GPL-3.0-or-later + +from PySide6.QtCore import QObject, Slot +from PySide6.QtQml import QQmlEngine + +from src import startup + + +# noinspection PyPep8Naming +class MyTestSetup(QObject): + @Slot(QQmlEngine) + def qmlEngineAvailable(self, _: QQmlEngine): + import rc_project # noqa: F401 + + startup.configure_qt_application_data() + startup.configure_environment_variables() + startup.import_bindings()