Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fabio/app/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
__author__ = "Gaël Goret, Jérôme Kieffer"
__copyright__ = "2015-2026 ESRF"
__licence__ = "MIT"
__date__ = "12/03/2026"
__date__ = "20/08/2026"


import sys
Expand Down
13 changes: 7 additions & 6 deletions src/fabio/qt/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
import numpy
from qtpy import QtWidgets as qt
from qtpy.QtWidgets import (
QMessageBox,
QLabel,
QDialog,
QDialogButtonBox,
QGroupBox,
)
QMessageBox,
QLabel,
QDialog,
QDialogButtonBox,
QGroupBox,
)


numpy.seterr(divide="ignore")
output_format = [
Expand Down
7 changes: 3 additions & 4 deletions src/fabio/qt/matplotlib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /*##########################################################################
#
# Copyright (c) 2016-2024 European Synchrotron Radiation Facility
# Copyright (c) 2016-2026 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -30,12 +30,10 @@
to the used backend.
"""

from __future__ import annotations


__authors__ = ["T. Vincent"]
__license__ = "MIT"
__date__ = "12/03/2026"
__date__ = "20/08/2026"


import io
Expand All @@ -45,6 +43,7 @@
from qtpy import API as BINDING
from qtpy.QtGui import QFont


# This must be performed before any import from matplotlib
if BINDING in ("pyside6", "pyqt6"):
matplotlib.use("QtAgg", force=False)
Expand Down
40 changes: 20 additions & 20 deletions src/fabio/qt/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@
from qtpy import QtCore as qtc
from qtpy.QtGui import QIcon
from qtpy.QtWidgets import (
QSizePolicy,
QFileDialog,
QMessageBox,
QAction,
QComboBox,
QPlainTextEdit,
QLabel,
QSplitter,
QTabWidget,
QWidget,
QProgressBar,
QGroupBox,
QVBoxLayout,
QHBoxLayout,
QPushButton,
QListWidget,
QCheckBox,
QButtonGroup
)
QSizePolicy,
QFileDialog,
QMessageBox,
QAction,
QComboBox,
QPlainTextEdit,
QLabel,
QSplitter,
QTabWidget,
QWidget,
QProgressBar,
QGroupBox,
QVBoxLayout,
QHBoxLayout,
QPushButton,
QListWidget,
QCheckBox,
QButtonGroup
)
# Matplotlib imports (unchanged)
from matplotlib.figure import Figure
from .matplotlib import FigureCanvasQTAgg
Expand Down Expand Up @@ -137,7 +137,7 @@ def format_header(self, d):

:param d: dict containing headers
:return: formatted string
"""
"""
keys = sorted(d.keys())
return " \n".join([f"{k}: {d[k]}" for k in keys]) + " \n"

Expand Down
15 changes: 10 additions & 5 deletions src/fabio/test/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@
class TestImport(unittest.TestCase):
def test_import_all(self):
import fabio

skip_without_qt = {
"fabio.app.viewer",
"fabio.qt.dialogs",
"fabio.qt.matplotlib",
}
with_qt = os.environ.get("WITH_QT_TEST", "True").lower() not in ("0", "false", "no")

base = os.path.split(fabio.__path__[0])[0] + "/"
for root, dirs, files in os.walk(fabio.__path__[0]):
for f in files:
if f.endswith(".py"):
module = os.path.join(root, f[:-3])[len(base) :].replace(
os.sep, "."
)
module = os.path.join(root, f[:-3])[len(base):].replace(os.sep, ".")
if not with_qt and module in skip_without_qt:
continue
__import__(module)


def suite():
loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
testsuite = unittest.TestSuite()
Expand Down
Loading