oe-python-template-example 0.4.2__py3-none-any.whl → 0.4.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ cli = typer.Typer(help="Command Line Interface of OE Python Template Example")
15
15
  prepare_cli(cli, f"🧠 OE Python Template Example v{__version__} - built with love in Berlin 🐻")
16
16
 
17
17
 
18
- if find_spec("nicegui"):
18
+ if find_spec("nicegui") and find_spec("webview"):
19
19
 
20
20
  @cli.command()
21
21
  def gui() -> None:
@@ -2,7 +2,6 @@
2
2
 
3
3
  from pathlib import Path
4
4
 
5
- import numpy as np
6
5
  from nicegui import ui
7
6
 
8
7
  from oe_python_template_example.utils import BasePageBuilder, GUILocalFilePicker
@@ -30,11 +29,16 @@ class PageBuilder(BasePageBuilder):
30
29
  "BUTTON_CLICK_ME"
31
30
  )
32
31
 
33
- with ui.card().tight().mark("CARD_PLOT"): # noqa: SIM117
34
- with ui.matplotlib(figsize=(4, 3)).figure as fig:
35
- x = np.linspace(0.0, 5.0)
36
- y = np.cos(2 * np.pi * x) * np.exp(-x)
37
- ax = fig.gca()
38
- ax.plot(x, y, "-")
32
+ from importlib.util import find_spec # noqa: PLC0415
33
+
34
+ if find_spec("matplotlib") and find_spec("numpy"):
35
+ import numpy as np # noqa: PLC0415
36
+
37
+ with ui.card().tight().mark("CARD_PLOT"): # noqa: SIM117
38
+ with ui.matplotlib(figsize=(4, 3)).figure as fig:
39
+ x = np.linspace(0.0, 5.0)
40
+ y = np.cos(2 * np.pi * x) * np.exp(-x)
41
+ ax = fig.gca()
42
+ ax.plot(x, y, "-")
39
43
 
40
44
  ui.link("Info", "/info").mark("LINK_INFO")
@@ -108,6 +108,7 @@ class Service(BaseService):
108
108
  "version": platform.python_version(),
109
109
  "compiler": platform.python_compiler(),
110
110
  "implementation": platform.python_implementation(),
111
+ "sys.path": sys.path,
111
112
  },
112
113
  "interpreter_path": sys.executable,
113
114
  "command_line": " ".join(sys.argv),