oe-python-template 0.13.4__py3-none-any.whl → 0.13.6__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.
- oe_python_template/cli.py +2 -2
- oe_python_template/utils/_gui.py +6 -2
- {oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/METADATA +13 -13
- {oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/RECORD +7 -7
- {oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/WHEEL +0 -0
- {oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/entry_points.txt +0 -0
- {oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/licenses/LICENSE +0 -0
oe_python_template/cli.py
CHANGED
@@ -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")
|
|
15
15
|
prepare_cli(cli, f"🧠 OE Python Template 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:
|
oe_python_template/utils/_gui.py
CHANGED
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oe-python-template
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.6
|
4
4
|
Summary: 🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling.
|
5
5
|
Project-URL: Homepage, https://oe-python-template.readthedocs.io/en/latest/
|
6
6
|
Project-URL: Documentation, https://oe-python-template.readthedocs.io/en/latest/
|
@@ -438,13 +438,22 @@ docker run helmuthva/oe-python-template system openapi --output-format=json
|
|
438
438
|
docker run helmuthva/oe-python-template system serve
|
439
439
|
```
|
440
440
|
|
441
|
-
|
441
|
+
The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
|
442
|
+
|
443
|
+
```shell
|
444
|
+
docker run helmuthva/oe-python-template-slim --help
|
445
|
+
docker run helmuthva/oe-python-template-slim hello world
|
446
|
+
```
|
447
|
+
|
448
|
+
You can pass environment variables as parameters:
|
442
449
|
|
443
450
|
```shell
|
444
|
-
docker run --env
|
451
|
+
docker run --env OE_PYTHON_TEMPLATE_HELLO_LANGUAGE=de_DE helmuthva/oe-python-template hello world
|
452
|
+
docker run --env OE_PYTHON_TEMPLATE_HELLO_LANGUAGE=en_US helmuthva/oe-python-template hello world
|
445
453
|
```
|
446
454
|
|
447
|
-
|
455
|
+
A docker compose stack is provided. Clone this repository using
|
456
|
+
`git clone git@github.com:helmut-hoffer-von-ankershoffen/oe-python-template.git` and enter the repository folder.
|
448
457
|
|
449
458
|
The .env is passed through from the host to the Docker container.
|
450
459
|
|
@@ -484,15 +493,6 @@ echo "Shutting down the API container ..."
|
|
484
493
|
docker compose down
|
485
494
|
```
|
486
495
|
|
487
|
-
#### Slim
|
488
|
-
|
489
|
-
The default Docker image includes all extras. Additionally a slim image is provided, with no extras. Run as follows
|
490
|
-
|
491
|
-
```shell
|
492
|
-
docker compose run --remove-orphans oe-python-template-slim --help
|
493
|
-
```
|
494
|
-
|
495
|
-
|
496
496
|
* See the [reference documentation of the API](https://oe-python-template.readthedocs.io/en/latest/api_reference_v1.html) for detailed documentation of all API operations and parameters.
|
497
497
|
|
498
498
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
oe_python_template/__init__.py,sha256=_Z3Xb-x95UODU66avOiwROVaouk_s0ZNB25KFnPoS40,226
|
2
2
|
oe_python_template/api.py,sha256=Hcpj4UYFrZBaE-O8Iwb7poGCCtlMIqrmNiFqJSKElqI,2190
|
3
|
-
oe_python_template/cli.py,sha256=
|
3
|
+
oe_python_template/cli.py,sha256=371khUxULDDmYkwf05MXNrgzpIoSgGY9CWp_DCICdxQ,1677
|
4
4
|
oe_python_template/constants.py,sha256=tIWRWxG7Ob-MwH8ucPplOMO3mCgXPo97acRjydpHiyg,330
|
5
5
|
oe_python_template/hello/__init__.py,sha256=F7aJ_uhTPPnFLT_4GjI2GzjAmKrUhfe4KxqzrljuCVo,485
|
6
6
|
oe_python_template/hello/_api.py,sha256=hWWlEDUfFY1se2ZzhqGMfPyD3FPwuA-YzxG9Q9z4F2o,2294
|
@@ -22,7 +22,7 @@ oe_python_template/utils/_cli.py,sha256=J_mFtXZ1gGeovGrE5i3wlokTOBfiTTKEz5magiRP
|
|
22
22
|
oe_python_template/utils/_console.py,sha256=u0-utcdRmVu4rabrYUyNOx8yPxLhxB3E92m22kSCwPQ,293
|
23
23
|
oe_python_template/utils/_constants.py,sha256=FRe5ZNaBwpBPwOHZVWYOlI-ijamfzdBVr8gl7gHMGT0,2932
|
24
24
|
oe_python_template/utils/_di.py,sha256=KdjiD4xZ_QSfbddkKWwsPJmG5YrIg6dzuBrlsd-FhxA,2189
|
25
|
-
oe_python_template/utils/_gui.py,sha256=
|
25
|
+
oe_python_template/utils/_gui.py,sha256=PmMTSmUOxbf6pmYCIgKrK5wNheh35aGd90I12y3L7Uc,5720
|
26
26
|
oe_python_template/utils/_health.py,sha256=35QOWe2r5InrEpGtuVMym9dI5aRHS0HWf4BHBRAUIj0,4102
|
27
27
|
oe_python_template/utils/_log.py,sha256=ZW4gs540SdjVK-2KeheLfDY15d_3xpO5FyGn7wTXyaM,3592
|
28
28
|
oe_python_template/utils/_logfire.py,sha256=wZYNVowQx7kh3XJoJ59FjUKdrta7tp6cXOJRUT6lDU8,2128
|
@@ -33,8 +33,8 @@ oe_python_template/utils/_service.py,sha256=atHAejvBucKXjzhsMSdOBBFa7rRD74zcV70P
|
|
33
33
|
oe_python_template/utils/_settings.py,sha256=owFoaHEzJnVD3EVyOWF4rfIY7g6eLnU6rN0m4VHhCbA,2464
|
34
34
|
oe_python_template/utils/boot.py,sha256=Qgq1sjT8d3fcfibnMyx5CVUJ_KKXgFI3ozZUIJbhh4I,2921
|
35
35
|
oe_python_template/utils/.vendored/bottle.py,sha256=kZAZmh3nRzCUf-9IKGpv0yqlMciZMA_DNaaMDdcQmt0,175437
|
36
|
-
oe_python_template-0.13.
|
37
|
-
oe_python_template-0.13.
|
38
|
-
oe_python_template-0.13.
|
39
|
-
oe_python_template-0.13.
|
40
|
-
oe_python_template-0.13.
|
36
|
+
oe_python_template-0.13.6.dist-info/METADATA,sha256=ehTfNQ73ovAfs8Aqdf4NoMuKlBkXaOtyE0Y4RKgzFgM,33856
|
37
|
+
oe_python_template-0.13.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
38
|
+
oe_python_template-0.13.6.dist-info/entry_points.txt,sha256=IroSSWhLGxus9rxcashkYQda39TTvf7LbUMYtOKXUBE,66
|
39
|
+
oe_python_template-0.13.6.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
|
40
|
+
oe_python_template-0.13.6.dist-info/RECORD,,
|
File without changes
|
{oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/entry_points.txt
RENAMED
File without changes
|
{oe_python_template-0.13.4.dist-info → oe_python_template-0.13.6.dist-info}/licenses/LICENSE
RENAMED
File without changes
|