From effdeb77d04ac8dda949304f0b926c863fe4f994 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:37:19 -0400 Subject: [PATCH 01/15] feat: add iconify --- examples/iconify.py | 15 +++++++ pyproject.toml | 1 + src/superqt/__init__.py | 2 + src/superqt/fonticon/__init__.py | 1 + src/superqt/iconify/__init__.py | 77 ++++++++++++++++++++++++++++++++ tests/test_iconify.py | 12 +++++ 6 files changed, 108 insertions(+) create mode 100644 examples/iconify.py create mode 100644 src/superqt/iconify/__init__.py create mode 100644 tests/test_iconify.py diff --git a/examples/iconify.py b/examples/iconify.py new file mode 100644 index 00000000..a4030e37 --- /dev/null +++ b/examples/iconify.py @@ -0,0 +1,15 @@ +from qtpy.QtCore import QSize +from qtpy.QtWidgets import QApplication, QPushButton + +from superqt import QIconifyIcon + +app = QApplication([]) + +btn = QPushButton() + +# search https://icon-sets.iconify.design for available icon keys +btn.setIcon(QIconifyIcon("fa:smile-o", color="blue")) +btn.setIconSize(QSize(60, 60)) +btn.show() + +app.exec() diff --git a/pyproject.toml b/pyproject.toml index 8e3c4a17..2396a5be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,6 +73,7 @@ font-fa5 = ["fonticon-fontawesome5"] font-fa6 = ["fonticon-fontawesome6"] font-mi6 = ["fonticon-materialdesignicons6"] font-mi7 = ["fonticon-materialdesignicons7"] +iconify = ["pyconify"] [project.urls] Documentation = "https://pyapp-kit.github.io/superqt/" diff --git a/src/superqt/__init__.py b/src/superqt/__init__.py index f03ea3ff..8080da12 100644 --- a/src/superqt/__init__.py +++ b/src/superqt/__init__.py @@ -10,6 +10,7 @@ from .collapsible import QCollapsible from .combobox import QColorComboBox, QEnumComboBox, QSearchableComboBox from .elidable import QElidingLabel, QElidingLineEdit +from .iconify import QIconifyIcon from .selection import QSearchableListWidget, QSearchableTreeWidget from .sliders import ( QDoubleRangeSlider, @@ -35,6 +36,7 @@ "QElidingLineEdit", "QEnumComboBox", "QLabeledDoubleRangeSlider", + "QIconifyIcon", "QLabeledDoubleSlider", "QLabeledRangeSlider", "QLabeledSlider", diff --git a/src/superqt/fonticon/__init__.py b/src/superqt/fonticon/__init__.py index 70ef5acd..732b1b25 100644 --- a/src/superqt/fonticon/__init__.py +++ b/src/superqt/fonticon/__init__.py @@ -10,6 +10,7 @@ "IconFontMeta", "IconOpts", "pulse", + "QIconifyIcon", "setTextIcon", "spin", ] diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py new file mode 100644 index 00000000..18228685 --- /dev/null +++ b/src/superqt/iconify/__init__.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from qtpy.QtGui import QIcon + +if TYPE_CHECKING: + from typing import Literal + + Flip = Literal["horizontal", "vertical", "horizontal,vertical"] + Rotation = Literal["90", "180", "270", 90, 180, 270, "-90", 1, 2, 3] + + +class QIconifyIcon(QIcon): + """QIcon backed by an iconify icon. + + This class is a thin wrapper around the + [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It creates a + temporary SVG file and uses it as the source for a QIcon. SVGs are cached to disk, + and persist across sessions (until `pyconify.clear_cache()` is called). + + Iconify includes 150,000+ icons from most major icon sets including Bootstrap, + FontAwesome, Material Design, and many more. + + Search availble icons at https://icon-sets.iconify.design + + Once you find one you like, use the key in the format `"prefix:name"` to create an + icon: `QIconifyIcon("bi:bell")`. + + Parameters + ---------- + *key: str + Icon set prefix and name. May be passed as a single string in the format + `"prefix:name"` or as two separate strings: `'prefix', 'name'`. + color : str, optional + Icon color. Replaces currentColor with specific color, resulting in icon with + hardcoded palette. + flip : str, optional + Flip icon. + rotate : str | int, optional + Rotate icon. If an integer is provided, it is assumed to be in degrees. + prefix : str, optional + If not None, the temp file name will begin with that prefix, otherwise a default + prefix is used. + dir : str, optional + If 'dir' is not None, the file will be created in that directory, otherwise a + default directory is used. + + Examples + -------- + >>> from qtpy.QtWidgets import QPushButton + >>> from superqt import QIconifyIcon + >>> btn = QPushButton() + >>> icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) + >>> btn.setIcon(icon) + """ + + def __init__( + self, + *key: str, + color: str | None = None, + flip: Flip | None = None, + rotate: Rotation | None = None, + prefix: str | None = None, + dir: str | None = None, + ): + try: + from pyconify import temp_svg + except ImportError: + raise ImportError( + "pyconify is required to use QIconifyIcon. " + "Please install it with `pip install pyconify`" + ) from None + self.path = temp_svg( + *key, color=color, flip=flip, rotate=rotate, prefix=prefix, dir=dir + ) + super().__init__(self.path) diff --git a/tests/test_iconify.py b/tests/test_iconify.py new file mode 100644 index 00000000..6a6bb9ef --- /dev/null +++ b/tests/test_iconify.py @@ -0,0 +1,12 @@ +from qtpy.QtWidgets import QPushButton + +from superqt import QIconifyIcon + + +def test_qiconify(qtbot): + icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) + assert icon.path.endswith(".svg") + btn = QPushButton() + qtbot.addWidget(btn) + btn.setIcon(icon) + btn.show() From e7d7cf414b8a4da3f1d5fc4a8f9ab3fff2b195c1 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:41:42 -0400 Subject: [PATCH 02/15] update docs --- examples/iconify.py | 1 - src/superqt/iconify/__init__.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/iconify.py b/examples/iconify.py index a4030e37..72894ae1 100644 --- a/examples/iconify.py +++ b/examples/iconify.py @@ -6,7 +6,6 @@ app = QApplication([]) btn = QPushButton() - # search https://icon-sets.iconify.design for available icon keys btn.setIcon(QIconifyIcon("fa:smile-o", color="blue")) btn.setIconSize(QSize(60, 60)) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 18228685..64ef5b95 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -15,9 +15,10 @@ class QIconifyIcon(QIcon): """QIcon backed by an iconify icon. This class is a thin wrapper around the - [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It creates a - temporary SVG file and uses it as the source for a QIcon. SVGs are cached to disk, - and persist across sessions (until `pyconify.clear_cache()` is called). + [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It pulls SVGs + from iconify, creates a temporary SVG file and uses it as the source for a QIcon. + SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()` + is called). Iconify includes 150,000+ icons from most major icon sets including Bootstrap, FontAwesome, Material Design, and many more. From e4cdcd18e5d9d9d6bee10fc5e617c3e0fc01e5ae Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:44:34 -0400 Subject: [PATCH 03/15] update docs --- src/superqt/iconify/__init__.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 64ef5b95..691bd4ee 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -34,15 +34,13 @@ class QIconifyIcon(QIcon): Icon set prefix and name. May be passed as a single string in the format `"prefix:name"` or as two separate strings: `'prefix', 'name'`. color : str, optional - Icon color. Replaces currentColor with specific color, resulting in icon with - hardcoded palette. + Icon color. If not provided, the icon will appear black (the icon fill color + will be set to the string "currentColor"). flip : str, optional - Flip icon. + Flip icon. Must be one of "horizontal", "vertical", "horizontal,vertical" rotate : str | int, optional - Rotate icon. If an integer is provided, it is assumed to be in degrees. - prefix : str, optional - If not None, the temp file name will begin with that prefix, otherwise a default - prefix is used. + Rotate icon. Must be one of 90, 180, 270, + or 1, 2, 3 (equivalent to 90, 180, 270, respectively) dir : str, optional If 'dir' is not None, the file will be created in that directory, otherwise a default directory is used. @@ -62,7 +60,6 @@ def __init__( color: str | None = None, flip: Flip | None = None, rotate: Rotation | None = None, - prefix: str | None = None, dir: str | None = None, ): try: @@ -72,7 +69,5 @@ def __init__( "pyconify is required to use QIconifyIcon. " "Please install it with `pip install pyconify`" ) from None - self.path = temp_svg( - *key, color=color, flip=flip, rotate=rotate, prefix=prefix, dir=dir - ) + self.path = temp_svg(*key, color=color, flip=flip, rotate=rotate, dir=dir) super().__init__(self.path) From 23c843085ce119cdc4b57d5ab31ce5718e22327c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:45:09 -0400 Subject: [PATCH 04/15] rearrange --- src/superqt/iconify/__init__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 691bd4ee..f66a5e25 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -14,20 +14,19 @@ class QIconifyIcon(QIcon): """QIcon backed by an iconify icon. - This class is a thin wrapper around the - [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It pulls SVGs - from iconify, creates a temporary SVG file and uses it as the source for a QIcon. - SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()` - is called). - Iconify includes 150,000+ icons from most major icon sets including Bootstrap, FontAwesome, Material Design, and many more. Search availble icons at https://icon-sets.iconify.design - Once you find one you like, use the key in the format `"prefix:name"` to create an icon: `QIconifyIcon("bi:bell")`. + This class is a thin wrapper around the + [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It pulls SVGs + from iconify, creates a temporary SVG file and uses it as the source for a QIcon. + SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()` + is called). + Parameters ---------- *key: str From 160b0538e1211379df023082f393b4903eed9d42 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:47:04 -0400 Subject: [PATCH 05/15] update example --- examples/iconify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/iconify.py b/examples/iconify.py index 72894ae1..254a0a22 100644 --- a/examples/iconify.py +++ b/examples/iconify.py @@ -7,7 +7,7 @@ btn = QPushButton() # search https://icon-sets.iconify.design for available icon keys -btn.setIcon(QIconifyIcon("fa:smile-o", color="blue")) +btn.setIcon(QIconifyIcon("fluent-emoji-flat:alarm-clock")) btn.setIconSize(QSize(60, 60)) btn.show() From 0281bb688de509bcc60af1bc36990a47d9645eba Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:48:00 -0400 Subject: [PATCH 06/15] update test deps --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2396a5be..3278d46d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ dependencies = [ # extras # https://peps.python.org/pep-0621/#dependencies-optional-dependencies [project.optional-dependencies] -test = ["pint", "pytest", "pytest-cov", "pytest-qt", "numpy", "cmap"] +test = ["pint", "pytest", "pytest-cov", "pytest-qt", "numpy", "cmap", "pyconify"] dev = [ "black", "ipython", From 969447ea3b70f2581caba2a9dffa5ee9b7f9c490 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Fri, 29 Sep 2023 21:49:08 -0400 Subject: [PATCH 07/15] importorskip --- tests/test_iconify.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_iconify.py b/tests/test_iconify.py index 6a6bb9ef..d18847ff 100644 --- a/tests/test_iconify.py +++ b/tests/test_iconify.py @@ -1,9 +1,11 @@ +import pytest from qtpy.QtWidgets import QPushButton from superqt import QIconifyIcon def test_qiconify(qtbot): + pytest.importorskip("pyconify") icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) assert icon.path.endswith(".svg") btn = QPushButton() From d33f704e2b3e5263cc5ae2fdc7385ff5ed5cb6b6 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 30 Sep 2023 07:28:54 -0400 Subject: [PATCH 08/15] Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota --- src/superqt/iconify/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index f66a5e25..826939e9 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -42,7 +42,7 @@ class QIconifyIcon(QIcon): or 1, 2, 3 (equivalent to 90, 180, 270, respectively) dir : str, optional If 'dir' is not None, the file will be created in that directory, otherwise a - default directory is used. + default [directory](https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp) is used. Examples -------- From bdcca51311067f5ffdf7ab551acc96383f6a9a64 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 30 Sep 2023 07:29:14 -0400 Subject: [PATCH 09/15] Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota --- src/superqt/iconify/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 826939e9..2e15edce 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -63,10 +63,10 @@ def __init__( ): try: from pyconify import temp_svg - except ImportError: + except ModuleNotFoundError as e: raise ImportError( "pyconify is required to use QIconifyIcon. " "Please install it with `pip install pyconify`" - ) from None + ) from e self.path = temp_svg(*key, color=color, flip=flip, rotate=rotate, dir=dir) super().__init__(self.path) From a27d0d83358834cace8bbc1f40dd7dfd16792ec9 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 30 Sep 2023 14:38:54 -0400 Subject: [PATCH 10/15] merge --- pyproject.toml | 2 +- src/superqt/iconify/__init__.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3278d46d..9c7f87d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ font-fa5 = ["fonticon-fontawesome5"] font-fa6 = ["fonticon-fontawesome6"] font-mi6 = ["fonticon-materialdesignicons6"] font-mi7 = ["fonticon-materialdesignicons7"] -iconify = ["pyconify"] +iconify = ["pyconify >=0.1.2"] [project.urls] Documentation = "https://pyapp-kit.github.io/superqt/" diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 2e15edce..9df5bb63 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -38,11 +38,13 @@ class QIconifyIcon(QIcon): flip : str, optional Flip icon. Must be one of "horizontal", "vertical", "horizontal,vertical" rotate : str | int, optional - Rotate icon. Must be one of 90, 180, 270, - or 1, 2, 3 (equivalent to 90, 180, 270, respectively) + Rotate icon. Must be one of 0, 90, 180, 270, + or 0, 1, 2, 3 (equivalent to 0, 90, 180, 270, respectively) dir : str, optional If 'dir' is not None, the file will be created in that directory, otherwise a - default [directory](https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp) is used. + default + [directory](https://docs.python.org/3/library/tempfile.html#tempfile.mkstemp) is + used. Examples -------- @@ -62,11 +64,12 @@ def __init__( dir: str | None = None, ): try: - from pyconify import temp_svg + from pyconify import svg_path except ModuleNotFoundError as e: raise ImportError( "pyconify is required to use QIconifyIcon. " - "Please install it with `pip install pyconify`" + "Please install it with `pip install iconify` or use the " + "`pip install superqt[iconify]` extra." ) from e - self.path = temp_svg(*key, color=color, flip=flip, rotate=rotate, dir=dir) + self.path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) super().__init__(self.path) From fb837e70c0ce62f00d4a0e4d766f8d42c7792902 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 30 Sep 2023 14:55:12 -0400 Subject: [PATCH 11/15] change test --- src/superqt/iconify/__init__.py | 2 +- tests/test_iconify.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 9df5bb63..247c7372 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -72,4 +72,4 @@ def __init__( "`pip install superqt[iconify]` extra." ) from e self.path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) - super().__init__(self.path) + super().__init__(str(self.path)) diff --git a/tests/test_iconify.py b/tests/test_iconify.py index d18847ff..add7e2d7 100644 --- a/tests/test_iconify.py +++ b/tests/test_iconify.py @@ -4,10 +4,13 @@ from superqt import QIconifyIcon -def test_qiconify(qtbot): +def test_qiconify(qtbot, tmp_path, monkeypatch): + monkeypatch.setenv("PYCONIFY_CACHE", "0") + pytest.importorskip("pyconify") - icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) - assert icon.path.endswith(".svg") + icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90, dir=tmp_path) + assert icon.path.name.endswith(".svg") + assert icon.path.parent == tmp_path btn = QPushButton() qtbot.addWidget(btn) btn.setIcon(icon) From f09f877da38cf38deea5526f49a6a113cdc0e8e1 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 4 Oct 2023 09:16:08 +0200 Subject: [PATCH 12/15] bump dep --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9c7f87d1..36c8f9f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ font-fa5 = ["fonticon-fontawesome5"] font-fa6 = ["fonticon-fontawesome6"] font-mi6 = ["fonticon-materialdesignicons6"] font-mi7 = ["fonticon-materialdesignicons7"] -iconify = ["pyconify >=0.1.2"] +iconify = ["pyconify >=0.1.3"] [project.urls] Documentation = "https://pyapp-kit.github.io/superqt/" From d8ad8509879e4d16cdc91c5c33154b7ee49f2794 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 4 Oct 2023 13:23:58 +0200 Subject: [PATCH 13/15] change doc --- src/superqt/iconify/__init__.py | 2 +- tests/test_iconify.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 247c7372..16dab76d 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -22,7 +22,7 @@ class QIconifyIcon(QIcon): icon: `QIconifyIcon("bi:bell")`. This class is a thin wrapper around the - [pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It pulls SVGs + [pyconify](https://github.com/pyapp-kit/pyconify) `svg_path` function. It pulls SVGs from iconify, creates a temporary SVG file and uses it as the source for a QIcon. SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()` is called). diff --git a/tests/test_iconify.py b/tests/test_iconify.py index add7e2d7..991c5b8c 100644 --- a/tests/test_iconify.py +++ b/tests/test_iconify.py @@ -1,16 +1,21 @@ +from typing import TYPE_CHECKING + import pytest from qtpy.QtWidgets import QPushButton from superqt import QIconifyIcon +if TYPE_CHECKING: + from pytestqt.qtbot import QtBot -def test_qiconify(qtbot, tmp_path, monkeypatch): - monkeypatch.setenv("PYCONIFY_CACHE", "0") +def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None: + monkeypatch.setenv("PYCONIFY_CACHE", "0") pytest.importorskip("pyconify") - icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90, dir=tmp_path) + + icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90) assert icon.path.name.endswith(".svg") - assert icon.path.parent == tmp_path + btn = QPushButton() qtbot.addWidget(btn) btn.setIcon(icon) From e34da4e86a3dfc678d38a896363a712ca545fa39 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 9 Oct 2023 09:04:18 -0400 Subject: [PATCH 14/15] Update src/superqt/iconify/__init__.py Co-authored-by: Grzegorz Bokota --- src/superqt/iconify/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index 16dab76d..ae8ced21 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -68,7 +68,7 @@ def __init__( except ModuleNotFoundError as e: raise ImportError( "pyconify is required to use QIconifyIcon. " - "Please install it with `pip install iconify` or use the " + "Please install it with `pip install pyconify` or use the " "`pip install superqt[iconify]` extra." ) from e self.path = svg_path(*key, color=color, flip=flip, rotate=rotate, dir=dir) From 3426f3d366a68a2d05ff87d242156c6f0e099708 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 9 Oct 2023 09:10:49 -0400 Subject: [PATCH 15/15] pragma and bump version --- pyproject.toml | 2 +- src/superqt/iconify/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a18b558a..fd8847e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ font-fa5 = ["fonticon-fontawesome5"] font-fa6 = ["fonticon-fontawesome6"] font-mi6 = ["fonticon-materialdesignicons6"] font-mi7 = ["fonticon-materialdesignicons7"] -iconify = ["pyconify >=0.1.3"] +iconify = ["pyconify >=0.1.4"] [project.urls] Documentation = "https://pyapp-kit.github.io/superqt/" diff --git a/src/superqt/iconify/__init__.py b/src/superqt/iconify/__init__.py index ae8ced21..92fbb813 100644 --- a/src/superqt/iconify/__init__.py +++ b/src/superqt/iconify/__init__.py @@ -65,7 +65,7 @@ def __init__( ): try: from pyconify import svg_path - except ModuleNotFoundError as e: + except ModuleNotFoundError as e: # pragma: no cover raise ImportError( "pyconify is required to use QIconifyIcon. " "Please install it with `pip install pyconify` or use the "