oe-python-template-example 0.4.3__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.3 → oe_python_template_example-0.4.5}/.gitignore +1 -1
  2. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/PKG-INFO +21 -17
  3. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/README.md +20 -16
  4. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/pyproject.toml +2 -2
  5. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/cli.py +2 -2
  6. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/.vendored/bottle.py +0 -1
  7. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_gui.py +6 -2
  8. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/LICENSE +0 -0
  9. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/__init__.py +0 -0
  10. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/api.py +0 -0
  11. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/constants.py +0 -0
  12. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/__init__.py +0 -0
  13. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_api.py +0 -0
  14. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_cli.py +0 -0
  15. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_constants.py +0 -0
  16. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_gui.py +0 -0
  17. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_models.py +0 -0
  18. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_service.py +0 -0
  19. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/hello/_settings.py +0 -0
  20. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/__init__.py +0 -0
  21. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_api.py +0 -0
  22. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_cli.py +0 -0
  23. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_gui.py +0 -0
  24. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_service.py +0 -0
  25. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/system/_settings.py +0 -0
  26. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/__init__.py +0 -0
  27. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_api.py +0 -0
  28. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_cli.py +0 -0
  29. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_console.py +0 -0
  30. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_constants.py +0 -0
  31. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_di.py +0 -0
  32. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_health.py +0 -0
  33. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_log.py +0 -0
  34. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_logfire.py +0 -0
  35. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_notebook.py +0 -0
  36. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_process.py +0 -0
  37. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_sentry.py +0 -0
  38. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_service.py +0 -0
  39. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/_settings.py +0 -0
  40. {oe_python_template_example-0.4.3 → oe_python_template_example-0.4.5}/src/oe_python_template_example/utils/boot.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.3
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/
@@ -376,11 +376,15 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
376
376
 
377
377
  ... or edit interactively within VSCode
378
378
 
379
- Install the
380
- [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
381
384
 
382
- Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
383
- 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
+ ```
384
388
 
385
389
  ## Command Line Interface (CLI)
386
390
 
@@ -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
 
@@ -302,11 +302,15 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
302
302
 
303
303
  ... or edit interactively within VSCode
304
304
 
305
- Install the
306
- [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
307
310
 
308
- Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
309
- 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
+ ```
310
314
 
311
315
  ## Command Line Interface (CLI)
312
316
 
@@ -365,13 +369,22 @@ docker run helmuthva/oe-python-template-example system openapi --output-format=j
365
369
  docker run helmuthva/oe-python-template-example system serve
366
370
  ```
367
371
 
368
- Execute command:
372
+ The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
369
373
 
370
374
  ```shell
371
- 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
372
377
  ```
373
378
 
374
- 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.
375
388
 
376
389
  The .env is passed through from the host to the Docker container.
377
390
 
@@ -411,15 +424,6 @@ echo "Shutting down the API container ..."
411
424
  docker compose down
412
425
  ```
413
426
 
414
- #### Slim
415
-
416
- The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
417
-
418
- ```shell
419
- docker compose run --remove-orphans oe-python-template-example-slim --help
420
- ```
421
-
422
-
423
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.
424
428
 
425
429
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oe-python-template-example"
3
- version = "0.4.3"
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 = [
@@ -281,7 +281,7 @@ source = ["src/"]
281
281
 
282
282
 
283
283
  [tool.bumpversion]
284
- current_version = "0.4.3"
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") and find_spec("webview"):
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:
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
2
  """
4
3
  Bottle is a fast and simple micro-framework for small web applications. It
5
4
  offers request dispatching (Routes) with URL parameter support, templates,
@@ -6,7 +6,7 @@ from types import EllipsisType
6
6
  from nicegui import app, events, ui
7
7
  from nicegui import native as native_app
8
8
 
9
- from ._constants import __project_name__
9
+ from ._constants import __is_running_in_container__, __project_name__
10
10
  from ._di import locate_subclasses
11
11
  from ._log import get_logger
12
12
 
@@ -55,8 +55,12 @@ def gui_run( # noqa: PLR0913, PLR0917
55
55
  with_api: Whether to mount the API.
56
56
 
57
57
  Raises:
58
- ValueError: If with_notebook is True but notebook_path is None.
58
+ ValueError: If with_notebook is True but notebook_path is None,
59
+ or trying to run native within container.
59
60
  """
61
+ if __is_running_in_container__ and native:
62
+ message = "Native GUI cannot be run in a container. Please run with uvx or in browser."
63
+ raise ValueError(message)
60
64
  if with_api:
61
65
  from ..api import api # noqa: PLC0415, TID252
62
66