ae-base 0.3.65__tar.gz → 0.3.66__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.
- {ae_base-0.3.65 → ae_base-0.3.66}/LICENSE.md +1 -1
- {ae_base-0.3.65/ae_base.egg-info → ae_base-0.3.66}/PKG-INFO +5 -5
- {ae_base-0.3.65 → ae_base-0.3.66}/README.md +4 -4
- {ae_base-0.3.65 → ae_base-0.3.66}/ae/base.py +24 -10
- {ae_base-0.3.65 → ae_base-0.3.66/ae_base.egg-info}/PKG-INFO +5 -5
- {ae_base-0.3.65 → ae_base-0.3.66}/setup.py +6 -6
- {ae_base-0.3.65 → ae_base-0.3.66}/tests/test_base.py +5 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/ae_base.egg-info/SOURCES.txt +0 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/ae_base.egg-info/dependency_links.txt +0 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/ae_base.egg-info/requires.txt +0 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/ae_base.egg-info/top_level.txt +0 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/ae_base.egg-info/zip-safe +0 -0
- {ae_base-0.3.65 → ae_base-0.3.66}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_base
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.66
|
|
4
4
|
Summary: ae namespace module portion base: basic constants, helper functions and context manager
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_base
|
|
6
6
|
Author: AndiEcker
|
|
@@ -67,15 +67,15 @@ Dynamic: provides-extra
|
|
|
67
67
|
Dynamic: requires-python
|
|
68
68
|
Dynamic: summary
|
|
69
69
|
|
|
70
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae
|
|
70
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.96 -->
|
|
71
71
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
72
|
-
# base 0.3.
|
|
72
|
+
# base 0.3.66
|
|
73
73
|
|
|
74
74
|
[](
|
|
75
75
|
https://gitlab.com/ae-group/ae_base)
|
|
76
76
|
[](
|
|
78
|
+
https://gitlab.com/ae-group/ae_base/-/tree/release0.3.65)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-base/#history)
|
|
81
81
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae
|
|
1
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.96 -->
|
|
2
2
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
3
|
-
# base 0.3.
|
|
3
|
+
# base 0.3.66
|
|
4
4
|
|
|
5
5
|
[](
|
|
6
6
|
https://gitlab.com/ae-group/ae_base)
|
|
7
7
|
[](
|
|
9
|
+
https://gitlab.com/ae-group/ae_base/-/tree/release0.3.65)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-base/#history)
|
|
12
12
|
|
|
@@ -32,7 +32,7 @@ sortable and compact string from a timestamp.
|
|
|
32
32
|
base helper functions
|
|
33
33
|
---------------------
|
|
34
34
|
|
|
35
|
-
the function :func:`evaluate_literal` can be used as
|
|
35
|
+
the function :func:`evaluate_literal` can be used as a replacement of :func:`ast.literal_eval` to retrieve
|
|
36
36
|
basic data structure values from config, ini and .env files, while also accepting unquoted strings as a `str` type
|
|
37
37
|
instance.
|
|
38
38
|
|
|
@@ -176,7 +176,7 @@ from types import ModuleType
|
|
|
176
176
|
from typing import Any, Callable, Generator, Iterable, MutableMapping, Optional, Union, cast
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
__version__ = '0.3.
|
|
179
|
+
__version__ = '0.3.66'
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
os_path_abspath = os.path.abspath
|
|
@@ -360,6 +360,7 @@ def deep_dict_update(data: dict, update: dict, overwrite: bool = True):
|
|
|
360
360
|
|
|
361
361
|
|
|
362
362
|
URI_SEP_CHAR = '⫻' # U+2AFB: TRIPLE SOLIDUS BINARY RELATION
|
|
363
|
+
# noinspection GrazieInspection
|
|
363
364
|
ASCII_UNICODE = (
|
|
364
365
|
('/', '⁄'), # U+2044: Fraction Slash; '∕' U+2215: Division Slash; '⧸' U+29F8: Big Solidus;
|
|
365
366
|
# '╱' U+FF0F: Fullwidth Solidus; '╱' U+2571: Box Drawings Light Diagonal Upper Right to Lower Left
|
|
@@ -433,7 +434,7 @@ def defuse(value: str) -> str:
|
|
|
433
434
|
in most unix variants only the slash and the ASCII 0 characters are not allowed in file names.
|
|
434
435
|
|
|
435
436
|
in MS Windows are not allowed: ASCII 0..31 / | \\ : * ? ” % < > ( ). some blogs recommend also not allowing
|
|
436
|
-
(convert) the characters
|
|
437
|
+
(convert) the characters `#` and `'`.
|
|
437
438
|
|
|
438
439
|
only old POSIX seems to be even more restricted (only allowing alphanumeric characters plus . - and _).
|
|
439
440
|
|
|
@@ -649,14 +650,26 @@ def in_wd(new_cwd: str) -> Generator[None, None, None]:
|
|
|
649
650
|
os.chdir(cur_dir)
|
|
650
651
|
|
|
651
652
|
|
|
652
|
-
def load_dotenvs():
|
|
653
|
-
""" detect and load
|
|
653
|
+
def load_dotenvs(from_module_path: bool = False):
|
|
654
|
+
""" detect and load not defined OS environment variables from ``.env`` files.
|
|
654
655
|
|
|
655
|
-
|
|
656
|
+
:param from_module_path: pass True to load OS environment variables (that are not already loaded from ``.env``
|
|
657
|
+
files situated in or above the current working directory) also from/above the folder of
|
|
658
|
+
the first module in the call stack that gets not excluded/skipped by :func:`stack_var`.
|
|
659
|
+
|
|
660
|
+
in order to also load ``.env`` files in/above the project folder.
|
|
661
|
+
call this function from the main module of project/app.
|
|
662
|
+
|
|
663
|
+
.. note::
|
|
664
|
+
only variables that are not already defined in the OS environment variables mapping :data:`os.environ` will be
|
|
665
|
+
loaded/added. variables will be loaded first from the first ``.env`` file found in or above the current working
|
|
666
|
+
directory, while the variable values in the deeper situated files are overwriting the values defined in the
|
|
667
|
+
``.env`` files situated in the above folders.
|
|
656
668
|
"""
|
|
657
669
|
env_vars = os.environ
|
|
658
670
|
load_env_var_defaults(os.getcwd(), env_vars)
|
|
659
|
-
|
|
671
|
+
|
|
672
|
+
if from_module_path and (file_name := stack_var('__file__')):
|
|
660
673
|
load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)), env_vars)
|
|
661
674
|
|
|
662
675
|
|
|
@@ -788,11 +801,12 @@ def module_name(*skip_modules: str, depth: int = 0) -> Optional[str]:
|
|
|
788
801
|
|
|
789
802
|
|
|
790
803
|
def norm_line_sep(text: str) -> str:
|
|
804
|
+
# noinspection GrazieInspection
|
|
791
805
|
""" convert any combination of line separators in the :paramref:`~norm_line_sep.text` arg to new-line characters.
|
|
792
806
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
807
|
+
:param text: string containing any combination of line separators ('\\\\r\\\\n' or '\\\\r').
|
|
808
|
+
:return: normalized/converted string with only new-line ('\\\\n') line separator characters.
|
|
809
|
+
"""
|
|
796
810
|
return text.replace('\r\n', '\n').replace('\r', '\n')
|
|
797
811
|
|
|
798
812
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_base
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.66
|
|
4
4
|
Summary: ae namespace module portion base: basic constants, helper functions and context manager
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_base
|
|
6
6
|
Author: AndiEcker
|
|
@@ -67,15 +67,15 @@ Dynamic: provides-extra
|
|
|
67
67
|
Dynamic: requires-python
|
|
68
68
|
Dynamic: summary
|
|
69
69
|
|
|
70
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae
|
|
70
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.96 -->
|
|
71
71
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
72
|
-
# base 0.3.
|
|
72
|
+
# base 0.3.66
|
|
73
73
|
|
|
74
74
|
[](
|
|
75
75
|
https://gitlab.com/ae-group/ae_base)
|
|
76
76
|
[](
|
|
78
|
+
https://gitlab.com/ae-group/ae_base/-/tree/release0.3.65)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-base/#history)
|
|
81
81
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.46
|
|
2
2
|
""" setup of ae namespace module portion base: basic constants, helper functions and context manager. """
|
|
3
3
|
# noinspection PyUnresolvedReferences
|
|
4
4
|
import sys
|
|
@@ -24,15 +24,15 @@ setup_kwargs = {
|
|
|
24
24
|
'install_requires': [],
|
|
25
25
|
'keywords': ['configuration', 'development', 'environment', 'productivity'],
|
|
26
26
|
'license': 'GPL-3.0-or-later',
|
|
27
|
-
'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae
|
|
27
|
+
'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.96 -->\n'
|
|
28
28
|
'<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->\n'
|
|
29
|
-
'# base 0.3.
|
|
29
|
+
'# base 0.3.66\n'
|
|
30
30
|
'\n'
|
|
31
31
|
'[](\n'
|
|
32
32
|
' https://gitlab.com/ae-group/ae_base)\n'
|
|
33
33
|
'[](\n'
|
|
35
|
+
' https://gitlab.com/ae-group/ae_base/-/tree/release0.3.65)\n'
|
|
36
36
|
'[](\n'
|
|
37
37
|
' https://pypi.org/project/ae-base/#history)\n'
|
|
38
38
|
'\n'
|
|
@@ -110,7 +110,7 @@ setup_kwargs = {
|
|
|
110
110
|
'python_requires': '>=3.9',
|
|
111
111
|
'setup_requires': [],
|
|
112
112
|
'url': 'https://gitlab.com/ae-group/ae_base',
|
|
113
|
-
'version': '0.3.
|
|
113
|
+
'version': '0.3.66',
|
|
114
114
|
'zip_safe': True,
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -543,6 +543,11 @@ class TestBaseHelpers:
|
|
|
543
543
|
load_dotenvs()
|
|
544
544
|
assert env_var_name not in os.environ
|
|
545
545
|
|
|
546
|
+
def test_load_dotenvs_from_module_path(self, os_env_test_env):
|
|
547
|
+
assert env_var_name not in os.environ
|
|
548
|
+
load_dotenvs(from_module_path=True)
|
|
549
|
+
assert env_var_name not in os.environ
|
|
550
|
+
|
|
546
551
|
def test_load_env_var_defaults_errors(self):
|
|
547
552
|
with pytest.raises(TypeError):
|
|
548
553
|
# noinspection PyArgumentList
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|