oe-python-template 0.14.0__tar.gz → 0.14.2__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.
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/PKG-INFO +1 -1
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/pyproject.toml +2 -2
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_cli.py +1 -1
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/__init__.py +2 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_constants.py +8 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_log.py +8 -5
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/.gitignore +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/LICENSE +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/README.md +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/__init__.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/api.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/cli.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/constants.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/__init__.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_api.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_cli.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_constants.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_gui.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_models.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_service.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_settings.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/__init__.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_api.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_gui.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_service.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_settings.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/.vendored/bottle.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_api.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_cli.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_console.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_di.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_gui.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_health.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_logfire.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_notebook.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_process.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_sentry.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_service.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_settings.py +0 -0
- {oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/boot.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oe-python-template
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.2
|
|
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/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "oe-python-template"
|
|
3
|
-
version = "0.14.
|
|
3
|
+
version = "0.14.2"
|
|
4
4
|
description = "🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Helmut Hoffer von Ankershoffen", email = "helmuthva@gmail.com" }]
|
|
@@ -279,7 +279,7 @@ source = ["src/"]
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
[tool.bumpversion]
|
|
282
|
-
current_version = "0.14.
|
|
282
|
+
current_version = "0.14.2"
|
|
283
283
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
284
284
|
serialize = ["{major}.{minor}.{patch}"]
|
|
285
285
|
search = "{current_version}"
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_cli.py
RENAMED
|
@@ -194,7 +194,7 @@ def fail() -> None:
|
|
|
194
194
|
|
|
195
195
|
@cli.command()
|
|
196
196
|
def sleep(
|
|
197
|
-
seconds: Annotated[int, typer.Option(help="Duration in seconds")] =
|
|
197
|
+
seconds: Annotated[int, typer.Option(help="Duration in seconds")] = 2,
|
|
198
198
|
) -> None:
|
|
199
199
|
"""Sleep given for given number of seconds.
|
|
200
200
|
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/__init__.py
RENAMED
|
@@ -12,6 +12,7 @@ from ._constants import (
|
|
|
12
12
|
__env_file__,
|
|
13
13
|
__is_development_mode__,
|
|
14
14
|
__is_running_in_container__,
|
|
15
|
+
__is_running_in_read_only_environment__,
|
|
15
16
|
__project_name__,
|
|
16
17
|
__project_path__,
|
|
17
18
|
__repository_url__,
|
|
@@ -46,6 +47,7 @@ __all__ = [
|
|
|
46
47
|
"__env_file__",
|
|
47
48
|
"__is_development_mode__",
|
|
48
49
|
"__is_running_in_container__",
|
|
50
|
+
"__is_running_in_read_only_environment__",
|
|
49
51
|
"__project_name__",
|
|
50
52
|
"__project_path__",
|
|
51
53
|
"__repository_url__",
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_constants.py
RENAMED
|
@@ -15,6 +15,14 @@ __version__ = metadata.version(__project_name__)
|
|
|
15
15
|
__is_development_mode__ = "uvx" not in sys.argv[0].lower()
|
|
16
16
|
__is_running_in_container__ = os.getenv(f"{__project_name__.upper()}_RUNNING_IN_CONTAINER")
|
|
17
17
|
|
|
18
|
+
# Determine if we're running in a read-only runtime environment
|
|
19
|
+
READ_ONLY_ENV_INDICATORS = [
|
|
20
|
+
f"{__project_name__.upper()}_RUNNING_IN_CONTAINER",
|
|
21
|
+
"VERCEL_ENV",
|
|
22
|
+
"RAILWAY_ENVIRONMENT",
|
|
23
|
+
]
|
|
24
|
+
__is_running_in_read_only_environment__ = any(os.getenv(env_var) is not None for env_var in READ_ONLY_ENV_INDICATORS)
|
|
25
|
+
|
|
18
26
|
# Determine environment we are deployed on
|
|
19
27
|
ENV_VAR_MAPPINGS = {
|
|
20
28
|
"ENV": lambda env: env,
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_log.py
RENAMED
|
@@ -14,7 +14,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
14
14
|
from rich.console import Console
|
|
15
15
|
from rich.logging import RichHandler
|
|
16
16
|
|
|
17
|
-
from ._constants import __env_file__, __project_name__
|
|
17
|
+
from ._constants import __env_file__, __is_running_in_read_only_environment__, __project_name__
|
|
18
18
|
from ._settings import load_settings
|
|
19
19
|
|
|
20
20
|
|
|
@@ -54,15 +54,15 @@ def _validate_file_name(file_name: str | None) -> str | None:
|
|
|
54
54
|
|
|
55
55
|
file_path = Path(file_name)
|
|
56
56
|
if file_path.exists():
|
|
57
|
-
if not file_path.is_file():
|
|
58
|
-
message = f"File name {file_path.absolute()} is not a file"
|
|
57
|
+
if not file_path.is_file() and not file_path.is_symlink():
|
|
58
|
+
message = f"File name {file_path.absolute()} is not a file or symlink"
|
|
59
59
|
raise ValueError(message)
|
|
60
60
|
if not os.access(file_path, os.W_OK):
|
|
61
61
|
message = f"File {file_path.absolute()} is not writable"
|
|
62
62
|
raise ValueError(message)
|
|
63
63
|
else:
|
|
64
64
|
try:
|
|
65
|
-
file_path.touch(exist_ok=
|
|
65
|
+
file_path.touch(exist_ok=True)
|
|
66
66
|
file_path.unlink()
|
|
67
67
|
except OSError as e:
|
|
68
68
|
message = f"File {file_path.absolute()} cannot be created: {e}"
|
|
@@ -92,7 +92,10 @@ class LogSettings(BaseSettings):
|
|
|
92
92
|
file_name: Annotated[
|
|
93
93
|
str,
|
|
94
94
|
AfterValidator(_validate_file_name),
|
|
95
|
-
Field(
|
|
95
|
+
Field(
|
|
96
|
+
description="Name of the log file",
|
|
97
|
+
default="/dev/stdout" if __is_running_in_read_only_environment__ else f"{__project_name__}.log",
|
|
98
|
+
),
|
|
96
99
|
]
|
|
97
100
|
console_enabled: Annotated[
|
|
98
101
|
bool,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/__init__.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_api.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_cli.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_constants.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_gui.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_models.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_service.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/hello/_settings.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/__init__.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_api.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_gui.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_service.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/system/_settings.py
RENAMED
|
File without changes
|
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_api.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_cli.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_console.py
RENAMED
|
File without changes
|
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_gui.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_health.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_logfire.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_notebook.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_process.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_sentry.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_service.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/_settings.py
RENAMED
|
File without changes
|
{oe_python_template-0.14.0 → oe_python_template-0.14.2}/src/oe_python_template/utils/boot.py
RENAMED
|
File without changes
|