oe-python-template-example 0.4.2__tar.gz → 0.4.5__tar.gz

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.
Files changed (40) hide show
  1. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/.gitignore +1 -1
  2. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/PKG-INFO +25 -21
  3. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/README.md +22 -16
  4. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/pyproject.toml +6 -6
  5. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/cli.py +2 -2
  6. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_gui.py +11 -7
  7. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_service.py +1 -0
  8. oe_python_template_example-0.4.5/src/oe_python_template_example/utils/.vendored/bottle.py +4562 -0
  9. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_gui.py +6 -2
  10. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/boot.py +6 -0
  11. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/LICENSE +0 -0
  12. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/__init__.py +0 -0
  13. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/api.py +0 -0
  14. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/constants.py +0 -0
  15. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/__init__.py +0 -0
  16. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_api.py +0 -0
  17. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_cli.py +0 -0
  18. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_constants.py +0 -0
  19. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_models.py +0 -0
  20. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_service.py +0 -0
  21. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_settings.py +0 -0
  22. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/__init__.py +0 -0
  23. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_api.py +0 -0
  24. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_cli.py +0 -0
  25. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_gui.py +0 -0
  26. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_settings.py +0 -0
  27. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/__init__.py +0 -0
  28. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_api.py +0 -0
  29. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_cli.py +0 -0
  30. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_console.py +0 -0
  31. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_constants.py +0 -0
  32. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_di.py +0 -0
  33. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_health.py +0 -0
  34. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_log.py +0 -0
  35. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_logfire.py +0 -0
  36. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_notebook.py +0 -0
  37. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_process.py +0 -0
  38. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_sentry.py +0 -0
  39. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_service.py +0 -0
  40. {oe_python_template_example-0.4.2 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_settings.py +0 -0
@@ -86,4 +86,4 @@ node_modules/
86
86
 
87
87
 
88
88
 
89
- # Application specific
89
+ # Application specific
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oe-python-template-example
3
- Version: 0.4.2
3
+ Version: 0.4.5
4
4
  Summary: 🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
5
5
  Project-URL: Homepage, https://oe-python-template-example.readthedocs.io/en/latest/
6
6
  Project-URL: Documentation, https://oe-python-template-example.readthedocs.io/en/latest/
@@ -50,6 +50,7 @@ Classifier: Typing :: Typed
50
50
  Requires-Python: <4.0,>=3.11
51
51
  Requires-Dist: fastapi[all,standard]>=0.115.12
52
52
  Requires-Dist: logfire[system-metrics]>=3.13.1
53
+ Requires-Dist: nicegui[native]>=2.15.0
53
54
  Requires-Dist: opentelemetry-instrumentation-fastapi>=0.53b0
54
55
  Requires-Dist: opentelemetry-instrumentation-httpx>=0.53b0
55
56
  Requires-Dist: opentelemetry-instrumentation-jinja2>=0.53b0
@@ -60,17 +61,14 @@ Requires-Dist: opentelemetry-instrumentation-urllib3>=0.53b0
60
61
  Requires-Dist: opentelemetry-instrumentation-urllib>=0.53b0
61
62
  Requires-Dist: psutil>=7.0.0
62
63
  Requires-Dist: pydantic-settings>=2.9.1
63
- Requires-Dist: pydantic>=2.11.3
64
64
  Requires-Dist: sentry-sdk>=2.26.1
65
65
  Requires-Dist: typer>=0.15.1
66
66
  Requires-Dist: uptime>=3.0.1
67
- Provides-Extra: app
68
- Requires-Dist: nicegui>=2.15.0; extra == 'app'
69
- Requires-Dist: pywebview>=5.4; extra == 'app'
70
67
  Provides-Extra: examples
71
68
  Requires-Dist: jinja2>=3.1.6; extra == 'examples'
72
69
  Requires-Dist: jupyter>=1.1.1; extra == 'examples'
73
70
  Requires-Dist: marimo>=0.13.0; extra == 'examples'
71
+ Requires-Dist: matplotlib>=3.10.1; extra == 'examples'
74
72
  Requires-Dist: streamlit>=1.44.1; extra == 'examples'
75
73
  Description-Content-Type: text/markdown
76
74
 
@@ -253,6 +251,7 @@ Executing the command line interface (CLI) in an isolated Python environment is
253
251
  uvx oe-python-template-example hello world # prints "Hello, world! [..]"
254
252
  uvx oe-python-template-example hello echo "Lorem Ipsum" # echos "Lorem Ipsum"
255
253
  uvx oe-python-template-example gui # opens the graphical user interface (GUI)
254
+ uvx --with "oe-python-template-example[examples]" oe-python-template-example gui # opens the graphical user interface (GUI) with support for scientific computing
256
255
  uvx oe-python-template-example system serve # serves web API
257
256
  uvx oe-python-template-example system serve --port=4711 # serves web API on port 4711
258
257
  uvx oe-python-template-example system openapi # serves web API on port 4711
@@ -377,11 +376,15 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
377
376
 
378
377
  ... or edit interactively within VSCode
379
378
 
380
- Install the
381
- [Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
379
+ Install the [Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
380
+
381
+ Click on `examples/notebook.py` in VSCode and click on the caret next to the Run icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
382
+
383
+ ... or without prior cloning of the repository
382
384
 
383
- Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
384
- icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
385
+ ```shell
386
+ uvx marimo run https://raw.githubusercontent.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/refs/heads/main/examples/notebook.py
387
+ ```
385
388
 
386
389
  ## Command Line Interface (CLI)
387
390
 
@@ -401,6 +404,7 @@ uvx oe-python-template-example hello echo --help
401
404
  uvx oe-python-template-example hello echo "Lorem"
402
405
  uvx oe-python-template-example hello echo "Lorem" --json
403
406
  uvx oe-python-template-example gui
407
+ uvx --with "oe-python-template-example[examples]" oe-python-template-example gui # opens the graphical user interface (GUI) with support for scientific computing
404
408
  uvx oe-python-template-example system info
405
409
  uvx oe-python-template-example system health
406
410
  uvx oe-python-template-example system openapi
@@ -439,13 +443,22 @@ docker run helmuthva/oe-python-template-example system openapi --output-format=j
439
443
  docker run helmuthva/oe-python-template-example system serve
440
444
  ```
441
445
 
442
- Execute command:
446
+ The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
443
447
 
444
448
  ```shell
445
- docker run --env THE_VAR=MY_VALUE helmuthva/oe-python-template-example hello echo "Lorem Ipsum"
449
+ docker run helmuthva/oe-python-template-example-slim --help
450
+ docker run helmuthva/oe-python-template-example-slim hello world
446
451
  ```
447
452
 
448
- Or use docker compose
453
+ You can pass environment variables as parameters:
454
+
455
+ ```shell
456
+ docker run --env OE_PYTHON_TEMPLATE_EXAMPLE_HELLO_LANGUAGE=de_DE helmuthva/oe-python-template-example hello world
457
+ docker run --env OE_PYTHON_TEMPLATE_EXAMPLE_HELLO_LANGUAGE=en_US helmuthva/oe-python-template-example hello world
458
+ ```
459
+
460
+ A docker compose stack is provided. Clone this repository using
461
+ `git clone git@github.com:helmut-hoffer-von-ankershoffen/oe-python-template-example.git` and enter the repository folder.
449
462
 
450
463
  The .env is passed through from the host to the Docker container.
451
464
 
@@ -485,15 +498,6 @@ echo "Shutting down the API container ..."
485
498
  docker compose down
486
499
  ```
487
500
 
488
- #### Slim
489
-
490
- The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
491
-
492
- ```shell
493
- docker compose run --remove-orphans oe-python-template-example-slim --help
494
- ```
495
-
496
-
497
501
  * See the [reference documentation of the API](https://oe-python-template-example.readthedocs.io/en/latest/api_reference_v1.html) for detailed documentation of all API operations and parameters.
498
502
 
499
503
 
@@ -177,6 +177,7 @@ Executing the command line interface (CLI) in an isolated Python environment is
177
177
  uvx oe-python-template-example hello world # prints "Hello, world! [..]"
178
178
  uvx oe-python-template-example hello echo "Lorem Ipsum" # echos "Lorem Ipsum"
179
179
  uvx oe-python-template-example gui # opens the graphical user interface (GUI)
180
+ uvx --with "oe-python-template-example[examples]" oe-python-template-example gui # opens the graphical user interface (GUI) with support for scientific computing
180
181
  uvx oe-python-template-example system serve # serves web API
181
182
  uvx oe-python-template-example system serve --port=4711 # serves web API on port 4711
182
183
  uvx oe-python-template-example system openapi # serves web API on port 4711
@@ -301,11 +302,15 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
301
302
 
302
303
  ... or edit interactively within VSCode
303
304
 
304
- Install the
305
- [Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
305
+ Install the [Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
306
+
307
+ Click on `examples/notebook.py` in VSCode and click on the caret next to the Run icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
308
+
309
+ ... or without prior cloning of the repository
306
310
 
307
- Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
308
- icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
311
+ ```shell
312
+ uvx marimo run https://raw.githubusercontent.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/refs/heads/main/examples/notebook.py
313
+ ```
309
314
 
310
315
  ## Command Line Interface (CLI)
311
316
 
@@ -325,6 +330,7 @@ uvx oe-python-template-example hello echo --help
325
330
  uvx oe-python-template-example hello echo "Lorem"
326
331
  uvx oe-python-template-example hello echo "Lorem" --json
327
332
  uvx oe-python-template-example gui
333
+ uvx --with "oe-python-template-example[examples]" oe-python-template-example gui # opens the graphical user interface (GUI) with support for scientific computing
328
334
  uvx oe-python-template-example system info
329
335
  uvx oe-python-template-example system health
330
336
  uvx oe-python-template-example system openapi
@@ -363,13 +369,22 @@ docker run helmuthva/oe-python-template-example system openapi --output-format=j
363
369
  docker run helmuthva/oe-python-template-example system serve
364
370
  ```
365
371
 
366
- Execute command:
372
+ The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
367
373
 
368
374
  ```shell
369
- docker run --env THE_VAR=MY_VALUE helmuthva/oe-python-template-example hello echo "Lorem Ipsum"
375
+ docker run helmuthva/oe-python-template-example-slim --help
376
+ docker run helmuthva/oe-python-template-example-slim hello world
370
377
  ```
371
378
 
372
- Or use docker compose
379
+ You can pass environment variables as parameters:
380
+
381
+ ```shell
382
+ docker run --env OE_PYTHON_TEMPLATE_EXAMPLE_HELLO_LANGUAGE=de_DE helmuthva/oe-python-template-example hello world
383
+ docker run --env OE_PYTHON_TEMPLATE_EXAMPLE_HELLO_LANGUAGE=en_US helmuthva/oe-python-template-example hello world
384
+ ```
385
+
386
+ A docker compose stack is provided. Clone this repository using
387
+ `git clone git@github.com:helmut-hoffer-von-ankershoffen/oe-python-template-example.git` and enter the repository folder.
373
388
 
374
389
  The .env is passed through from the host to the Docker container.
375
390
 
@@ -409,15 +424,6 @@ echo "Shutting down the API container ..."
409
424
  docker compose down
410
425
  ```
411
426
 
412
- #### Slim
413
-
414
- The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
415
-
416
- ```shell
417
- docker compose run --remove-orphans oe-python-template-example-slim --help
418
- ```
419
-
420
-
421
427
  * See the [reference documentation of the API](https://oe-python-template-example.readthedocs.io/en/latest/api_reference_v1.html) for detailed documentation of all API operations and parameters.
422
428
 
423
429
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oe-python-template-example"
3
- version = "0.4.2"
3
+ version = "0.4.5"
4
4
  description = "🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template)."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -65,6 +65,7 @@ dependencies = [
65
65
  # From Template
66
66
  "fastapi[standard,all]>=0.115.12",
67
67
  "logfire[system-metrics]>=3.13.1",
68
+ "nicegui[native]>=2.15.0",
68
69
  "opentelemetry-instrumentation-fastapi>=0.53b0",
69
70
  "opentelemetry-instrumentation-httpx>=0.53b0",
70
71
  "opentelemetry-instrumentation-jinja2>=0.53b0",
@@ -74,7 +75,6 @@ dependencies = [
74
75
  "opentelemetry-instrumentation-urllib>=0.53b0",
75
76
  "opentelemetry-instrumentation-urllib3>=0.53b0",
76
77
  "psutil>=7.0.0",
77
- "pydantic>=2.11.3",
78
78
  "pydantic-settings>=2.9.1",
79
79
  "sentry-sdk>=2.26.1",
80
80
  "typer>=0.15.1",
@@ -89,8 +89,8 @@ examples = [
89
89
  "marimo>=0.13.0",
90
90
  "jupyter>=1.1.1",
91
91
  "jinja2>=3.1.6",
92
+ "matplotlib>=3.10.1",
92
93
  ]
93
- app = ["nicegui>=2.15.0", "pywebview>=5.4"]
94
94
 
95
95
  [dependency-groups]
96
96
  dev = [
@@ -161,13 +161,12 @@ override-dependencies = [ # https://github.com/astral-sh/uv/issues/4422
161
161
  "rfc3987; sys_platform == 'never'", # GPLv3
162
162
  ]
163
163
 
164
-
165
164
  [tool.ruff]
166
165
  target-version = "py311"
167
166
  preview = true
168
167
  fix = true
169
168
  line-length = 120
170
- extend-exclude = [".fixme", "notebook.py", "template/*.py"]
169
+ extend-exclude = [".fixme", "notebook.py", "template/*.py", "bottle.py"]
171
170
 
172
171
  [tool.ruff.lint]
173
172
  select = ["ALL"]
@@ -230,6 +229,7 @@ docstring-code-format = true
230
229
  convention = "google"
231
230
 
232
231
  [tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html
232
+ exclude = ["bottle.py"]
233
233
  junit_xml = "reports/mypy_junit.xml"
234
234
  plugins = "pydantic.mypy"
235
235
  strict = true
@@ -281,7 +281,7 @@ source = ["src/"]
281
281
 
282
282
 
283
283
  [tool.bumpversion]
284
- current_version = "0.4.2"
284
+ current_version = "0.4.5"
285
285
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
286
286
  serialize = ["{major}.{minor}.{patch}"]
287
287
  search = "{current_version}"
@@ -6,7 +6,7 @@ from importlib.util import find_spec
6
6
  import typer
7
7
 
8
8
  from .constants import MODULES_TO_INSTRUMENT
9
- from .utils import __version__, boot, console, get_logger, prepare_cli
9
+ from .utils import __is_running_in_container__, __version__, boot, console, get_logger, prepare_cli
10
10
 
11
11
  boot(MODULES_TO_INSTRUMENT)
12
12
  logger = get_logger(__name__)
@@ -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") and not __is_running_in_container__:
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),