diff --git a/.github/workflows/webviz-config.yml b/.github/workflows/webviz-config.yml index 366a7a6b..2a50ed56 100644 --- a/.github/workflows/webviz-config.yml +++ b/.github/workflows/webviz-config.yml @@ -21,7 +21,7 @@ jobs: PYTHONWARNINGS: default # We want to see e.g. DeprecationWarnings strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: 📖 Checkout commit locally diff --git a/tests/test_create_themed_layout.py b/tests/test_create_themed_layout.py index 56585037..26694b6b 100644 --- a/tests/test_create_themed_layout.py +++ b/tests/test_create_themed_layout.py @@ -147,4 +147,4 @@ def test_create_themed_layout_on_app(dash_duo): # test some values assert new_layout["colorway"] == specified_layout["colorway"] assert new_layout["xaxis"]["title"]["text"] == "Title" - assert dash_duo.get_logs() == [], "browser console should contain no error" + assert dash_duo.get_logs() is None, "browser console should contain no error" diff --git a/tests/test_data_table.py b/tests/test_data_table.py index 44d25803..6902bde2 100644 --- a/tests/test_data_table.py +++ b/tests/test_data_table.py @@ -21,7 +21,7 @@ def test_data_table(dash_duo): page = _data_table.DataTable(app, code_file) app.layout = page.layout dash_duo.start_server(app) - assert dash_duo.get_logs() == [], "browser console should contain no error" + assert dash_duo.get_logs() is None, "browser console should contain no error" def test_data_table_with_settings(dash_duo): @@ -39,4 +39,4 @@ def test_data_table_with_settings(dash_duo): ) app.layout = page.layout dash_duo.start_server(app) - assert dash_duo.get_logs() == [], "browser console should contain no error" + assert dash_duo.get_logs() is None, "browser console should contain no error" diff --git a/tests/test_example_wlf_plugin.py b/tests/test_example_wlf_plugin.py index 4c18e85e..822af064 100644 --- a/tests/test_example_wlf_plugin.py +++ b/tests/test_example_wlf_plugin.py @@ -23,4 +23,4 @@ def test_example_wlf_plugin( ) _webviz_duo.wait_for_contains_text(component_id, "x - y") - assert _webviz_duo.get_logs() == [] + assert _webviz_duo.get_logs() is None diff --git a/tests/test_portable.py b/tests/test_portable.py index 8255052b..7a037784 100644 --- a/tests/test_portable.py +++ b/tests/test_portable.py @@ -24,4 +24,4 @@ def test_portable(dash_duo, tmp_path): "pivot-table", ]: dash_duo.wait_for_element(f".Menu__Page[href='/{page}']").click() - assert dash_duo.get_logs() == [], "browser console should contain no error" + assert dash_duo.get_logs() is None, "browser console should contain no error" diff --git a/tests/test_syntax_highlighter.py b/tests/test_syntax_highlighter.py index 70a65557..5a10b2d0 100644 --- a/tests/test_syntax_highlighter.py +++ b/tests/test_syntax_highlighter.py @@ -20,4 +20,4 @@ def test_syntax_highlighter(dash_duo): page = _syntax_highlighter.SyntaxHighlighter(app, code_file) app.layout = page.layout dash_duo.start_server(app) - assert dash_duo.get_logs() == [], "browser console should contain no error" + assert dash_duo.get_logs() is None, "browser console should contain no error" diff --git a/webviz_config/themes/__init__.py b/webviz_config/themes/__init__.py index b0bfb492..063f39c6 100644 --- a/webviz_config/themes/__init__.py +++ b/webviz_config/themes/__init__.py @@ -1,3 +1,4 @@ +import sys from importlib.metadata import entry_points from .. import WebvizConfigTheme @@ -7,11 +8,23 @@ __all__ = ["installed_themes"] -for entry_point in entry_points().get("webviz_config_themes", []): - theme = entry_point.load() +if sys.version_info < (3, 10, 0): + for entry_point in entry_points().get("webviz_config_themes", []): + theme = entry_point.load() - globals()[entry_point.name] = theme - __all__.append(entry_point.name) + globals()[entry_point.name] = theme + __all__.append(entry_point.name) - if isinstance(theme, WebvizConfigTheme): - installed_themes[theme.theme_name] = theme + if isinstance(theme, WebvizConfigTheme): + installed_themes[theme.theme_name] = theme +else: + for entry_point in entry_points( # pylint: disable=unexpected-keyword-arg + group="webviz_config_themes" + ): + theme = entry_point.load() + + globals()[entry_point.name] = theme + __all__.append(entry_point.name) + + if isinstance(theme, WebvizConfigTheme): + installed_themes[theme.theme_name] = theme