ae-base 0.3.64__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.64 → ae_base-0.3.66}/LICENSE.md +1 -1
- {ae_base-0.3.64/ae_base.egg-info → ae_base-0.3.66}/PKG-INFO +8 -8
- {ae_base-0.3.64 → ae_base-0.3.66}/README.md +4 -4
- {ae_base-0.3.64 → ae_base-0.3.66}/ae/base.py +42 -9
- {ae_base-0.3.64 → ae_base-0.3.66/ae_base.egg-info}/PKG-INFO +8 -8
- {ae_base-0.3.64 → ae_base-0.3.66}/ae_base.egg-info/requires.txt +1 -1
- ae_base-0.3.66/setup.py +119 -0
- {ae_base-0.3.64 → ae_base-0.3.66}/tests/test_base.py +32 -1
- ae_base-0.3.64/setup.py +0 -33
- {ae_base-0.3.64 → ae_base-0.3.66}/ae_base.egg-info/SOURCES.txt +0 -0
- {ae_base-0.3.64 → ae_base-0.3.66}/ae_base.egg-info/dependency_links.txt +0 -0
- {ae_base-0.3.64 → ae_base-0.3.66}/ae_base.egg-info/top_level.txt +0 -0
- {ae_base-0.3.64 → ae_base-0.3.66}/ae_base.egg-info/zip-safe +0 -0
- {ae_base-0.3.64 → ae_base-0.3.66}/setup.cfg +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
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
|
|
7
7
|
Author-email: aecker2@gmail.com
|
|
8
|
-
License:
|
|
8
|
+
License: GPL-3.0-or-later
|
|
9
9
|
Project-URL: Bug Tracker, https://gitlab.com/ae-group/ae_base/-/issues
|
|
10
10
|
Project-URL: Documentation, https://ae.readthedocs.io/en/latest/_autosummary/ae.base.html
|
|
11
11
|
Project-URL: Repository, https://gitlab.com/ae-group/ae_base
|
|
12
12
|
Project-URL: Source, https://ae.readthedocs.io/en/latest/_modules/ae/base.html
|
|
13
13
|
Keywords: configuration,development,environment,productivity
|
|
14
14
|
Classifier: Development Status :: 3 - Alpha
|
|
15
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
16
15
|
Classifier: Natural Language :: English
|
|
17
16
|
Classifier: Operating System :: OS Independent
|
|
18
17
|
Classifier: Programming Language :: Python
|
|
19
18
|
Classifier: Programming Language :: Python :: 3
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
22
|
Requires-Python: >=3.9
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
25
|
Provides-Extra: dev
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: aedev_project_tpls; extra == "dev"
|
|
27
27
|
Requires-Dist: ae_ae; extra == "dev"
|
|
28
28
|
Requires-Dist: anybadge; extra == "dev"
|
|
29
29
|
Requires-Dist: coverage-badge; extra == "dev"
|
|
@@ -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,6 +32,10 @@ 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 a replacement of :func:`ast.literal_eval` to retrieve
|
|
36
|
+
basic data structure values from config, ini and .env files, while also accepting unquoted strings as a `str` type
|
|
37
|
+
instance.
|
|
38
|
+
|
|
35
39
|
most programming languages providing a function to determine the sign of a number. the :func:`sign` functino,
|
|
36
40
|
provided by this module/portion is filling this gap in Python.
|
|
37
41
|
|
|
@@ -148,6 +152,7 @@ os.path shortcuts
|
|
|
148
152
|
the following data items are pointers to shortcut at runtime the lookup to their related functions in the
|
|
149
153
|
Python module :mod:`os.path`:
|
|
150
154
|
"""
|
|
155
|
+
# pylint: disable=too-many-lines
|
|
151
156
|
import datetime
|
|
152
157
|
import getpass
|
|
153
158
|
import importlib.abc
|
|
@@ -171,7 +176,7 @@ from types import ModuleType
|
|
|
171
176
|
from typing import Any, Callable, Generator, Iterable, MutableMapping, Optional, Union, cast
|
|
172
177
|
|
|
173
178
|
|
|
174
|
-
__version__ = '0.3.
|
|
179
|
+
__version__ = '0.3.66'
|
|
175
180
|
|
|
176
181
|
|
|
177
182
|
os_path_abspath = os.path.abspath
|
|
@@ -355,6 +360,7 @@ def deep_dict_update(data: dict, update: dict, overwrite: bool = True):
|
|
|
355
360
|
|
|
356
361
|
|
|
357
362
|
URI_SEP_CHAR = '⫻' # U+2AFB: TRIPLE SOLIDUS BINARY RELATION
|
|
363
|
+
# noinspection GrazieInspection
|
|
358
364
|
ASCII_UNICODE = (
|
|
359
365
|
('/', '⁄'), # U+2044: Fraction Slash; '∕' U+2215: Division Slash; '⧸' U+29F8: Big Solidus;
|
|
360
366
|
# '╱' U+FF0F: Fullwidth Solidus; '╱' U+2571: Box Drawings Light Diagonal Upper Right to Lower Left
|
|
@@ -428,7 +434,7 @@ def defuse(value: str) -> str:
|
|
|
428
434
|
in most unix variants only the slash and the ASCII 0 characters are not allowed in file names.
|
|
429
435
|
|
|
430
436
|
in MS Windows are not allowed: ASCII 0..31 / | \\ : * ? ” % < > ( ). some blogs recommend also not allowing
|
|
431
|
-
(convert) the characters
|
|
437
|
+
(convert) the characters `#` and `'`.
|
|
432
438
|
|
|
433
439
|
only old POSIX seems to be even more restricted (only allowing alphanumeric characters plus . - and _).
|
|
434
440
|
|
|
@@ -494,6 +500,20 @@ def env_str(name: str, convert_name: bool = False) -> Optional[str]:
|
|
|
494
500
|
return os.environ.get(name)
|
|
495
501
|
|
|
496
502
|
|
|
503
|
+
def evaluate_literal(literal_string: str) -> Any:
|
|
504
|
+
""" evaluates a Python expression while accepting unquoted strings as str type.
|
|
505
|
+
|
|
506
|
+
:param literal_string: any literal of the base types (like dict, list, set, tuple) which are recognized
|
|
507
|
+
by :func:`ast.literal_eval`.
|
|
508
|
+
:return: an instance of the data type or the specified string, even if it is not quoted with
|
|
509
|
+
high comma characters.
|
|
510
|
+
"""
|
|
511
|
+
try:
|
|
512
|
+
return literal_eval(literal_string)
|
|
513
|
+
except (IndentationError, SyntaxError, TypeError, ValueError):
|
|
514
|
+
return literal_string
|
|
515
|
+
|
|
516
|
+
|
|
497
517
|
def force_encoding(text: Union[str, bytes], encoding: str = DEF_ENCODING, errors: str = DEF_ENCODE_ERRORS) -> str:
|
|
498
518
|
""" force/ensure the encoding of text (str or bytes) without any UnicodeDecodeError/UnicodeEncodeError.
|
|
499
519
|
|
|
@@ -630,14 +650,26 @@ def in_wd(new_cwd: str) -> Generator[None, None, None]:
|
|
|
630
650
|
os.chdir(cur_dir)
|
|
631
651
|
|
|
632
652
|
|
|
633
|
-
def load_dotenvs():
|
|
634
|
-
""" detect and load
|
|
653
|
+
def load_dotenvs(from_module_path: bool = False):
|
|
654
|
+
""" detect and load not defined OS environment variables from ``.env`` files.
|
|
635
655
|
|
|
636
|
-
|
|
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.
|
|
637
668
|
"""
|
|
638
669
|
env_vars = os.environ
|
|
639
670
|
load_env_var_defaults(os.getcwd(), env_vars)
|
|
640
|
-
|
|
671
|
+
|
|
672
|
+
if from_module_path and (file_name := stack_var('__file__')):
|
|
641
673
|
load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)), env_vars)
|
|
642
674
|
|
|
643
675
|
|
|
@@ -769,11 +801,12 @@ def module_name(*skip_modules: str, depth: int = 0) -> Optional[str]:
|
|
|
769
801
|
|
|
770
802
|
|
|
771
803
|
def norm_line_sep(text: str) -> str:
|
|
804
|
+
# noinspection GrazieInspection
|
|
772
805
|
""" convert any combination of line separators in the :paramref:`~norm_line_sep.text` arg to new-line characters.
|
|
773
806
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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
|
+
"""
|
|
777
810
|
return text.replace('\r\n', '\n').replace('\r', '\n')
|
|
778
811
|
|
|
779
812
|
|
|
@@ -1,29 +1,29 @@
|
|
|
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
|
|
7
7
|
Author-email: aecker2@gmail.com
|
|
8
|
-
License:
|
|
8
|
+
License: GPL-3.0-or-later
|
|
9
9
|
Project-URL: Bug Tracker, https://gitlab.com/ae-group/ae_base/-/issues
|
|
10
10
|
Project-URL: Documentation, https://ae.readthedocs.io/en/latest/_autosummary/ae.base.html
|
|
11
11
|
Project-URL: Repository, https://gitlab.com/ae-group/ae_base
|
|
12
12
|
Project-URL: Source, https://ae.readthedocs.io/en/latest/_modules/ae/base.html
|
|
13
13
|
Keywords: configuration,development,environment,productivity
|
|
14
14
|
Classifier: Development Status :: 3 - Alpha
|
|
15
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
16
15
|
Classifier: Natural Language :: English
|
|
17
16
|
Classifier: Operating System :: OS Independent
|
|
18
17
|
Classifier: Programming Language :: Python
|
|
19
18
|
Classifier: Programming Language :: Python :: 3
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
22
|
Requires-Python: >=3.9
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
25
|
Provides-Extra: dev
|
|
26
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: aedev_project_tpls; extra == "dev"
|
|
27
27
|
Requires-Dist: ae_ae; extra == "dev"
|
|
28
28
|
Requires-Dist: anybadge; extra == "dev"
|
|
29
29
|
Requires-Dist: coverage-badge; extra == "dev"
|
|
@@ -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
|
|
ae_base-0.3.66/setup.py
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.46
|
|
2
|
+
""" setup of ae namespace module portion base: basic constants, helper functions and context manager. """
|
|
3
|
+
# noinspection PyUnresolvedReferences
|
|
4
|
+
import sys
|
|
5
|
+
print(f"SetUp {__name__=} {sys.executable=} {sys.argv=} {sys.path=}")
|
|
6
|
+
|
|
7
|
+
# noinspection PyUnresolvedReferences
|
|
8
|
+
import setuptools
|
|
9
|
+
|
|
10
|
+
setup_kwargs = {
|
|
11
|
+
'author': 'AndiEcker',
|
|
12
|
+
'author_email': 'aecker2@gmail.com',
|
|
13
|
+
'classifiers': [ 'Development Status :: 3 - Alpha', 'Natural Language :: English', 'Operating System :: OS Independent',
|
|
14
|
+
'Programming Language :: Python', 'Programming Language :: Python :: 3',
|
|
15
|
+
'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules',
|
|
16
|
+
'Typing :: Typed'],
|
|
17
|
+
'description': 'ae namespace module portion base: basic constants, helper functions and context manager',
|
|
18
|
+
'extras_require': { 'dev': [ 'aedev_project_tpls', 'ae_ae', 'anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8',
|
|
19
|
+
'mypy', 'pylint', 'pytest', 'pytest-cov', 'pytest-django', 'typing', 'types-setuptools', 'wheel',
|
|
20
|
+
'twine'],
|
|
21
|
+
'docs': [],
|
|
22
|
+
'tests': [ 'anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8', 'mypy', 'pylint', 'pytest',
|
|
23
|
+
'pytest-cov', 'pytest-django', 'typing', 'types-setuptools', 'wheel', 'twine']},
|
|
24
|
+
'install_requires': [],
|
|
25
|
+
'keywords': ['configuration', 'development', 'environment', 'productivity'],
|
|
26
|
+
'license': 'GPL-3.0-or-later',
|
|
27
|
+
'long_description': ('<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.96 -->\n'
|
|
28
|
+
'<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->\n'
|
|
29
|
+
'# base 0.3.66\n'
|
|
30
|
+
'\n'
|
|
31
|
+
'[](\n'
|
|
32
|
+
' https://gitlab.com/ae-group/ae_base)\n'
|
|
33
|
+
'[](\n'
|
|
35
|
+
' https://gitlab.com/ae-group/ae_base/-/tree/release0.3.65)\n'
|
|
36
|
+
'[](\n'
|
|
37
|
+
' https://pypi.org/project/ae-base/#history)\n'
|
|
38
|
+
'\n'
|
|
39
|
+
'>ae namespace module portion base: basic constants, helper functions and context manager.\n'
|
|
40
|
+
'\n'
|
|
41
|
+
'[](\n'
|
|
42
|
+
' https://ae-group.gitlab.io/ae_base/coverage/index.html)\n'
|
|
43
|
+
'[](\n'
|
|
44
|
+
' https://ae-group.gitlab.io/ae_base/lineprecision.txt)\n'
|
|
45
|
+
'[](\n'
|
|
46
|
+
' https://ae-group.gitlab.io/ae_base/pylint.log)\n'
|
|
47
|
+
'\n'
|
|
48
|
+
'[](\n'
|
|
49
|
+
' https://gitlab.com/ae-group/ae_base/)\n'
|
|
50
|
+
'[](\n'
|
|
51
|
+
' https://gitlab.com/ae-group/ae_base/)\n'
|
|
52
|
+
'[](\n'
|
|
53
|
+
' https://gitlab.com/ae-group/ae_base/)\n'
|
|
54
|
+
'[](\n'
|
|
55
|
+
' https://pypi.org/project/ae-base/)\n'
|
|
56
|
+
'[](\n'
|
|
57
|
+
' https://gitlab.com/ae-group/ae_base/-/blob/develop/LICENSE.md)\n'
|
|
58
|
+
'[](\n'
|
|
59
|
+
' https://libraries.io/pypi/ae-base)\n'
|
|
60
|
+
'[](\n'
|
|
61
|
+
' https://pypi.org/project/ae-base/#files)\n'
|
|
62
|
+
'\n'
|
|
63
|
+
'\n'
|
|
64
|
+
'## installation\n'
|
|
65
|
+
'\n'
|
|
66
|
+
'\n'
|
|
67
|
+
'execute the following command to install the\n'
|
|
68
|
+
'ae.base module\n'
|
|
69
|
+
'in the currently active virtual environment:\n'
|
|
70
|
+
' \n'
|
|
71
|
+
'```shell script\n'
|
|
72
|
+
'pip install ae-base\n'
|
|
73
|
+
'```\n'
|
|
74
|
+
'\n'
|
|
75
|
+
'if you want to contribute to this portion then first fork\n'
|
|
76
|
+
'[the ae_base repository at GitLab](\n'
|
|
77
|
+
'https://gitlab.com/ae-group/ae_base "ae.base code repository").\n'
|
|
78
|
+
'after that pull it to your machine and finally execute the\n'
|
|
79
|
+
'following command in the root folder of this repository\n'
|
|
80
|
+
'(ae_base):\n'
|
|
81
|
+
'\n'
|
|
82
|
+
'```shell script\n'
|
|
83
|
+
'pip install -e .[dev]\n'
|
|
84
|
+
'```\n'
|
|
85
|
+
'\n'
|
|
86
|
+
'the last command will install this module portion, along with the tools you need\n'
|
|
87
|
+
'to develop and run tests or to extend the portion documentation. to contribute only to the unit tests or to the\n'
|
|
88
|
+
'documentation of this portion, replace the setup extras key `dev` in the above command with `tests` or `docs`\n'
|
|
89
|
+
'respectively.\n'
|
|
90
|
+
'\n'
|
|
91
|
+
'more detailed explanations on how to contribute to this project\n'
|
|
92
|
+
'[are available here](\n'
|
|
93
|
+
'https://gitlab.com/ae-group/ae_base/-/blob/develop/CONTRIBUTING.rst)\n'
|
|
94
|
+
'\n'
|
|
95
|
+
'\n'
|
|
96
|
+
'## namespace portion documentation\n'
|
|
97
|
+
'\n'
|
|
98
|
+
'information on the features and usage of this portion are available at\n'
|
|
99
|
+
'[ReadTheDocs](\n'
|
|
100
|
+
'https://ae.readthedocs.io/en/latest/_autosummary/ae.base.html\n'
|
|
101
|
+
'"ae_base documentation").\n'),
|
|
102
|
+
'long_description_content_type': 'text/markdown',
|
|
103
|
+
'name': 'ae_base',
|
|
104
|
+
'package_data': {'': []},
|
|
105
|
+
'packages': ['ae'],
|
|
106
|
+
'project_urls': { 'Bug Tracker': 'https://gitlab.com/ae-group/ae_base/-/issues',
|
|
107
|
+
'Documentation': 'https://ae.readthedocs.io/en/latest/_autosummary/ae.base.html',
|
|
108
|
+
'Repository': 'https://gitlab.com/ae-group/ae_base',
|
|
109
|
+
'Source': 'https://ae.readthedocs.io/en/latest/_modules/ae/base.html'},
|
|
110
|
+
'python_requires': '>=3.9',
|
|
111
|
+
'setup_requires': [],
|
|
112
|
+
'url': 'https://gitlab.com/ae-group/ae_base',
|
|
113
|
+
'version': '0.3.66',
|
|
114
|
+
'zip_safe': True,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if __name__ == "__main__":
|
|
118
|
+
setuptools.setup(**setup_kwargs)
|
|
119
|
+
pass
|
|
@@ -20,7 +20,7 @@ from ae.base import (
|
|
|
20
20
|
ASCII_TO_UNICODE, BUILD_CONFIG_FILE, DOTENV_FILE_NAME, PY_EXT, PY_INIT, PY_MAIN, TESTS_FOLDER, UNICODE_TO_ASCII,
|
|
21
21
|
UNSET, URI_SEP_CHAR,
|
|
22
22
|
app_name_guess, ascii_str, build_config_variable_values, camel_to_snake,
|
|
23
|
-
dedefuse, deep_dict_update, defuse, dummy_function, duplicates, env_str,
|
|
23
|
+
dedefuse, deep_dict_update, defuse, dummy_function, duplicates, env_str, evaluate_literal,
|
|
24
24
|
force_encoding, format_given, full_stack_trace, import_module, instantiate_config_parser, in_wd,
|
|
25
25
|
load_env_var_defaults, load_dotenvs, main_file_paths_parts, mask_secrets, module_attr,
|
|
26
26
|
module_file_path, module_name, norm_line_sep, norm_name, norm_path, now_str,
|
|
@@ -361,6 +361,32 @@ class TestBaseHelpers:
|
|
|
361
361
|
os.environ['NON_ALPHA_NUM_CHARS_69'] = vv
|
|
362
362
|
assert env_str(ev, convert_name=True) == vv
|
|
363
363
|
|
|
364
|
+
def test_evaluate_literal(self):
|
|
365
|
+
tst_str = "unquoted string"
|
|
366
|
+
|
|
367
|
+
assert evaluate_literal(tst_str) == tst_str # actually: evaluate_literal(tst_str) is tst_str
|
|
368
|
+
|
|
369
|
+
assert evaluate_literal("'" + tst_str + "'") == tst_str
|
|
370
|
+
|
|
371
|
+
tst_dict = dict(a=1, b=[dict(b3=3), (1, 2, 3), set()])
|
|
372
|
+
|
|
373
|
+
assert evaluate_literal(repr(tst_dict)) == tst_dict
|
|
374
|
+
|
|
375
|
+
def test_evaluate_literal_errors(self):
|
|
376
|
+
assert evaluate_literal("") == ""
|
|
377
|
+
|
|
378
|
+
# noinspection PyTypeChecker
|
|
379
|
+
assert evaluate_literal(None) is None # raising ValueError: malformed node or string: None
|
|
380
|
+
|
|
381
|
+
tst = dict(a=1, b=[dict(b3=3), (1, "22", 333), set()])
|
|
382
|
+
|
|
383
|
+
assert evaluate_literal(" " + repr(tst) + " ") == " " + repr(tst) + " " # raising IndentationError
|
|
384
|
+
|
|
385
|
+
assert evaluate_literal(repr(tst) + " ") == tst # trailing white space chars are ok
|
|
386
|
+
|
|
387
|
+
# noinspection PyTypeChecker
|
|
388
|
+
assert evaluate_literal(tst) is tst
|
|
389
|
+
|
|
364
390
|
def test_force_encoding_bytes(self):
|
|
365
391
|
s = 'äöü'
|
|
366
392
|
|
|
@@ -517,6 +543,11 @@ class TestBaseHelpers:
|
|
|
517
543
|
load_dotenvs()
|
|
518
544
|
assert env_var_name not in os.environ
|
|
519
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
|
+
|
|
520
551
|
def test_load_env_var_defaults_errors(self):
|
|
521
552
|
with pytest.raises(TypeError):
|
|
522
553
|
# noinspection PyArgumentList
|
ae_base-0.3.64/setup.py
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_project V0.3.36
|
|
2
|
-
""" setup of ae namespace module portion base: basic constants, helper functions and context manager. """
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# noinspection PyUnresolvedReferences
|
|
7
|
-
import setuptools
|
|
8
|
-
|
|
9
|
-
setup_kwargs = {
|
|
10
|
-
'author': 'AndiEcker',
|
|
11
|
-
'author_email': 'aecker2@gmail.com',
|
|
12
|
-
'classifiers': ['Development Status :: 3 - Alpha', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules'],
|
|
13
|
-
'description': 'ae namespace module portion base: basic constants, helper functions and context manager',
|
|
14
|
-
'extras_require': {'dev': ['aedev_tpl_project', 'ae_ae', 'anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8', 'mypy', 'pylint', 'pytest', 'pytest-cov', 'pytest-django', 'typing', 'types-setuptools', 'wheel', 'twine'], 'docs': [], 'tests': ['anybadge', 'coverage-badge', 'aedev_git_repo_manager', 'flake8', 'mypy', 'pylint', 'pytest', 'pytest-cov', 'pytest-django', 'typing', 'types-setuptools', 'wheel', 'twine']},
|
|
15
|
-
'install_requires': [],
|
|
16
|
-
'keywords': ['configuration', 'development', 'environment', 'productivity'],
|
|
17
|
-
'license': 'OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
|
|
18
|
-
'long_description': '<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.96 -->\n<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->\n# base 0.3.64\n\n[](\n https://gitlab.com/ae-group/ae_base)\n[](\n https://gitlab.com/ae-group/ae_base/-/tree/release0.3.63)\n[](\n https://pypi.org/project/ae-base/#history)\n\n>ae namespace module portion base: basic constants, helper functions and context manager.\n\n[](\n https://ae-group.gitlab.io/ae_base/coverage/index.html)\n[](\n https://ae-group.gitlab.io/ae_base/lineprecision.txt)\n[](\n https://ae-group.gitlab.io/ae_base/pylint.log)\n\n[](\n https://gitlab.com/ae-group/ae_base/)\n[](\n https://gitlab.com/ae-group/ae_base/)\n[](\n https://gitlab.com/ae-group/ae_base/)\n[](\n https://pypi.org/project/ae-base/)\n[](\n https://gitlab.com/ae-group/ae_base/-/blob/develop/LICENSE.md)\n[](\n https://libraries.io/pypi/ae-base)\n[](\n https://pypi.org/project/ae-base/#files)\n\n\n## installation\n\n\nexecute the following command to install the\nae.base module\nin the currently active virtual environment:\n \n```shell script\npip install ae-base\n```\n\nif you want to contribute to this portion then first fork\n[the ae_base repository at GitLab](\nhttps://gitlab.com/ae-group/ae_base "ae.base code repository").\nafter that pull it to your machine and finally execute the\nfollowing command in the root folder of this repository\n(ae_base):\n\n```shell script\npip install -e .[dev]\n```\n\nthe last command will install this module portion, along with the tools you need\nto develop and run tests or to extend the portion documentation. to contribute only to the unit tests or to the\ndocumentation of this portion, replace the setup extras key `dev` in the above command with `tests` or `docs`\nrespectively.\n\nmore detailed explanations on how to contribute to this project\n[are available here](\nhttps://gitlab.com/ae-group/ae_base/-/blob/develop/CONTRIBUTING.rst)\n\n\n## namespace portion documentation\n\ninformation on the features and usage of this portion are available at\n[ReadTheDocs](\nhttps://ae.readthedocs.io/en/latest/_autosummary/ae.base.html\n"ae_base documentation").\n',
|
|
19
|
-
'long_description_content_type': 'text/markdown',
|
|
20
|
-
'name': 'ae_base',
|
|
21
|
-
'package_data': {'': []},
|
|
22
|
-
'packages': ['ae'],
|
|
23
|
-
'project_urls': {'Bug Tracker': 'https://gitlab.com/ae-group/ae_base/-/issues', 'Documentation': 'https://ae.readthedocs.io/en/latest/_autosummary/ae.base.html', 'Repository': 'https://gitlab.com/ae-group/ae_base', 'Source': 'https://ae.readthedocs.io/en/latest/_modules/ae/base.html'},
|
|
24
|
-
'python_requires': '>=3.9',
|
|
25
|
-
'setup_requires': ['aedev_setup_project'],
|
|
26
|
-
'url': 'https://gitlab.com/ae-group/ae_base',
|
|
27
|
-
'version': '0.3.64',
|
|
28
|
-
'zip_safe': True,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if __name__ == "__main__":
|
|
32
|
-
setuptools.setup(**setup_kwargs)
|
|
33
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|