From bef4df878b89d7f06fe62d82ef1f3f8c74ea0566 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Fri, 2 Apr 2021 12:44:40 -0700 Subject: [PATCH 1/8] MNT: force loaded template to be pathlib.Path, not string --- typhos/display.py | 1 + 1 file changed, 1 insertion(+) diff --git a/typhos/display.py b/typhos/display.py index 3a0fca8c8..950b51b42 100644 --- a/typhos/display.py +++ b/typhos/display.py @@ -903,6 +903,7 @@ def _get_templates_from_macros(macros): def _load_template(self, filename): """Load template from file and return the widget.""" + filename = pathlib.Path(filename) loader = (pydm.display.load_py_file if filename.suffix == '.py' else pydm.display.load_ui_file) From 1c61b017fe92c5e9103b8ba9168249c3e7355907 Mon Sep 17 00:00:00 2001 From: Ken Lauer Date: Fri, 2 Apr 2021 16:59:10 -0700 Subject: [PATCH 2/8] FIX: further pathlib-related exceptions --- typhos/display.py | 1 + 1 file changed, 1 insertion(+) diff --git a/typhos/display.py b/typhos/display.py index 950b51b42..df4537ae0 100644 --- a/typhos/display.py +++ b/typhos/display.py @@ -834,6 +834,7 @@ def load_best_template(self): widget = QtWidgets.QWidget() template = None else: + template = pathlib.Path(template) try: widget = self._load_template(template) except Exception as ex: From f2f7b3cc8fbea1e76f9019f71efc1a4b9f6aeb3c Mon Sep 17 00:00:00 2001 From: Ken Lauer Date: Fri, 2 Apr 2021 17:32:57 -0700 Subject: [PATCH 3/8] MNT: don't crash if loading old one fails --- typhos/display.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typhos/display.py b/typhos/display.py index df4537ae0..9400fdc4f 100644 --- a/typhos/display.py +++ b/typhos/display.py @@ -842,7 +842,16 @@ def load_best_template(self): # If we have a previously defined template if self._current_template is not None: # Fallback to it so users have a choice - widget = self._load_template(self._current_template) + try: + widget = self._load_template(self._current_template) + except Exception: + logger.exception( + "Failed to fall back to previous template", + self._current_template + ) + template = None + widget = None + pydm.exception.raise_to_operator(ex) else: widget = QtWidgets.QWidget() From d9370c48e0c1c2c6356191fe9f1569c213e2a0d2 Mon Sep 17 00:00:00 2001 From: Ken Lauer Date: Fri, 2 Apr 2021 17:36:03 -0700 Subject: [PATCH 4/8] MNT: patch raise_to_operator --- typhos/tests/test_cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typhos/tests/test_cli.py b/typhos/tests/test_cli.py index 5af2fcfaf..53cd9c242 100644 --- a/typhos/tests/test_cli.py +++ b/typhos/tests/test_cli.py @@ -1,5 +1,6 @@ import os +import pydm import pytest import typhos @@ -38,6 +39,9 @@ def test_cli_no_entry(monkeypatch, qtbot, happi_cfg): def test_cli_stylesheet(monkeypatch, qapp, qtbot, happi_cfg): monkeypatch.setattr(QApplication, 'exec_', lambda x: 1) + monkeypatch.setattr( + pydm.exception, 'raise_to_operator', lambda *_, **__: None + ) with open('test.qss', 'w+') as handle: handle.write( "TyphosDeviceDisplay {qproperty-force_template: 'test.ui'}") From c1206dae769630fb89c4eaed2059d103627f48a4 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Mon, 5 Apr 2021 13:17:47 -0700 Subject: [PATCH 5/8] BLD: force newest timechart version --- conda-recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 35a486833..92803b7f8 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -30,7 +30,7 @@ requirements: - qdarkstyle - qtawesome - qtconsole - - timechart + - timechart >=1.2.4 about: home: https://github.com/pcdshub/typhos @@ -52,4 +52,4 @@ extra: recipe-maintainers: - klauer - hhslepicka - - zllentz \ No newline at end of file + - zllentz From af32d42becad7b70b639f7c0412ce7f72d7f9fd0 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Mon, 5 Apr 2021 14:17:21 -0700 Subject: [PATCH 6/8] Add release notes for v1.1.6 --- docs/source/release_notes.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 25018262e..367210857 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -2,6 +2,21 @@ Release History ================= +v1.1.6 (2020-04-05) +=================== + +Description +----------- +This is maintenance/compatibility release for pydm v1.11.0. + +Compatibility / Fixes +--------------------- +- Internal fixes regarding error handling and input sanitization. + Some subtle issues cropped up here in the update to pydm v1.11.0. +- Fix issue where the test suite would freeze when pydm displays + an exception to the user. + + v1.1.5 (2020-04-02) =================== From f38a3ba3b41113222d724abb2764125a3ca84228 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Mon, 5 Apr 2021 14:19:57 -0700 Subject: [PATCH 7/8] DOC: year typo in release notes Co-authored-by: Ken Lauer --- docs/source/release_notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 367210857..f6f837737 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -2,7 +2,7 @@ Release History ================= -v1.1.6 (2020-04-05) +v1.1.6 (2021-04-05) =================== Description From 293e85547d0c9b32f7ff01f6a6c8bb305380c8a8 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Mon, 5 Apr 2021 14:23:32 -0700 Subject: [PATCH 8/8] Update typhos/display.py Co-authored-by: Ken Lauer --- typhos/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typhos/display.py b/typhos/display.py index 9400fdc4f..4e08c4837 100644 --- a/typhos/display.py +++ b/typhos/display.py @@ -846,7 +846,7 @@ def load_best_template(self): widget = self._load_template(self._current_template) except Exception: logger.exception( - "Failed to fall back to previous template", + "Failed to fall back to previous template: %s", self._current_template ) template = None