Skip to content

Commit

Permalink
py 3.11 3.12 (#675)
Browse files Browse the repository at this point in the history
support python 3.11 and 3.12
  • Loading branch information
asnyv authored Jan 26, 2024
1 parent f805463 commit bc55a41
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 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
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a href="https://github.com/equinor/webviz-config/actions?query=branch%3Amaster"><img src="https://github.com/equinor/webviz-config/workflows/webviz-config/badge.svg"></a>
<a href="https://lgtm.com/projects/g/equinor/webviz-config/alerts/"><img alt="Total alerts" src="https://img.shields.io/lgtm/alerts/g/equinor/webviz-config.svg?logo=lgtm&logoWidth=18"/></a>
<a href="https://lgtm.com/projects/g/equinor/webviz-config/context:python"><img alt="Language grade: Python" src="https://img.shields.io/lgtm/grade/python/g/equinor/webviz-config.svg?logo=lgtm&logoWidth=18"/></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10-blue.svg"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12-blue.svg"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>
<br/>
Expand All @@ -30,7 +30,7 @@ Writing a [Dash web application](https://github.com/plotly/dash) gives a lot of
*Webviz™* is a MIT-licensed configuration layer on top of Dash, which encourages making reusable components and dashboards, which can then be added/removed when creating an application using a short [`yaml`](https://en.wikipedia.org/wiki/YAML) configuration file.

This Python package, `webviz-config`, is the core plugin framework. For a real example repository using this plugin system, see e.g. [`webviz-subsurface`](https://github.com/equinor/webviz-subsurface).

**These are the main user groups targeted by *Webviz™*:**
- **You do not know Python**, and only want to add different predefined dashboards or visualizations/components in a certain order and/or on different pages in the application. Optionally with some text and mathematical equations (that you provide) inbetween the dashboards, explaining what the user is looking at.
- **You know [Python](https://www.python.org/)**, and want to create generic or specialized dashboards you or other users can reuse by simply asking for it in the Webviz™ configuration file. This can be done without knowing JavaScript (see also [Dash](https://plot.ly/dash/) for more information).
Expand Down Expand Up @@ -104,4 +104,3 @@ To quickly get started, we recommend using the corresponding
`webviz-config` is, with a few exceptions listed below, [MIT](./LICENSE) licensed.

- The [`webviz-config` logo](./webviz_config/_docs/static/webviz-logo.svg) is [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/)

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"
10 changes: 9 additions & 1 deletion 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,7 +8,14 @@

__all__ = ["installed_themes"]

for entry_point in entry_points().get("webviz_config_themes", []):
for entry_point in (
entry_points().get("webviz_config_themes", [])
if sys.version_info < (3, 10, 0)
else entry_points( # pylint: disable=unexpected-keyword-arg
group="webviz_config_themes"
)
):

theme = entry_point.load()

globals()[entry_point.name] = theme
Expand Down

0 comments on commit bc55a41

Please sign in to comment.