Skip to content

Commit 91efe73

Browse files
authored
Merge pull request #1834 from HEXRD/unpin-pyside6
Unpin PySide6
2 parents aa2a94e + db6d729 commit 91efe73

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

conda.recipe/meta.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,7 @@ requirements:
2828
- pyhdf
2929
# This next one is needed to fix the app name on Mac
3030
- pyobjc-framework-cocoa # [osx]
31-
# Lock the PySide6 version to be less than 6.8 for Mac.
32-
# This is because Qt 6.8 has some crashing issue we need
33-
# to resolve. This issue is tracked in:
34-
# https://github.com/HEXRD/hexrdgui/issues/1931
35-
- pyside6<6.8 # [osx]
36-
- pyside6 # [not osx]
31+
- pyside6
3732
- pyyaml
3833
- silx-base
3934

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
'fabio>=0.11',
99
'matplotlib',
1010
'Pillow',
11-
# PySide 6.8.0 is causing segmentation faults in the testing
12-
# Keep this version downgraded until that is fixed.
13-
'pyside6<6.8.0',
11+
'pyside6',
1412
'pyyaml',
1513
'silx',
1614
]

tests/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import gc
12
import os
23
from pathlib import Path
34

45
import pytest
56

67
from PySide6.QtCore import QSettings
8+
from PySide6.QtWidgets import QApplication
79

810
from hexrdgui.main_window import MainWindow
911

@@ -41,3 +43,25 @@ def main_window(qtbot):
4143
window.confirm_application_close = False
4244
qtbot.addWidget(window.ui)
4345
return window
46+
47+
48+
# This next fixture is necessary starting in Qt 6.8, to ensure
49+
# all Qt objects are destroyed before Python finalizes.
50+
# This may not be required anymore after we drop support
51+
# for Python 3.11. The Python3.14 tests pass without it. We
52+
# can try removing this after we drop support of Python versions.
53+
@pytest.fixture(scope="session", autouse=True)
54+
def cleanup_qt():
55+
"""Clean up Qt objects before Python finalizes."""
56+
yield
57+
# After all tests complete, before Python exits
58+
app = QApplication.instance()
59+
if app:
60+
# Close all windows
61+
for widget in app.topLevelWidgets():
62+
widget.close()
63+
widget.deleteLater()
64+
# Process pending events
65+
app.processEvents()
66+
# Force garbage collection
67+
gc.collect()

0 commit comments

Comments
 (0)