Skip to content

Commit

Permalink
support python 3.11 and 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
asnyv committed Jan 26, 2024
1 parent f805463 commit 66403b5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/webviz-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_create_themed_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions tests/test_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"
2 changes: 1 addition & 1 deletion tests/test_example_wlf_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/test_portable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion tests/test_syntax_highlighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
25 changes: 19 additions & 6 deletions webviz_config/themes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from importlib.metadata import entry_points

from .. import WebvizConfigTheme
Expand All @@ -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

0 comments on commit 66403b5

Please sign in to comment.