ae-base 0.3.56__tar.gz → 0.3.59__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.56 → ae_base-0.3.59}/LICENSE.md +1 -1
- {ae_base-0.3.56/ae_base.egg-info → ae_base-0.3.59}/PKG-INFO +6 -6
- {ae_base-0.3.56 → ae_base-0.3.59}/README.md +5 -5
- {ae_base-0.3.56 → ae_base-0.3.59}/ae/base.py +18 -17
- {ae_base-0.3.56 → ae_base-0.3.59/ae_base.egg-info}/PKG-INFO +6 -6
- ae_base-0.3.59/setup.py +33 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/tests/test_base.py +75 -13
- ae_base-0.3.56/setup.py +0 -18
- {ae_base-0.3.56 → ae_base-0.3.59}/ae_base.egg-info/SOURCES.txt +0 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/ae_base.egg-info/dependency_links.txt +0 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/ae_base.egg-info/requires.txt +0 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/ae_base.egg-info/top_level.txt +0 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/ae_base.egg-info/zip-safe +0 -0
- {ae_base-0.3.56 → ae_base-0.3.59}/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.59
|
|
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,19 +67,19 @@ 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 V0.3.
|
|
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.59
|
|
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.57)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-base/#history)
|
|
81
81
|
|
|
82
|
-
>
|
|
82
|
+
>ae namespace module portion base: basic constants, helper functions and context manager.
|
|
83
83
|
|
|
84
84
|
[](
|
|
85
85
|
https://ae-group.gitlab.io/ae_base/coverage/index.html)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.
|
|
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.59
|
|
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.57)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-base/#history)
|
|
12
12
|
|
|
13
|
-
>
|
|
13
|
+
>ae namespace module portion base: basic constants, helper functions and context manager.
|
|
14
14
|
|
|
15
15
|
[](
|
|
16
16
|
https://ae-group.gitlab.io/ae_base/coverage/index.html)
|
|
@@ -168,10 +168,10 @@ from contextlib import contextmanager
|
|
|
168
168
|
from importlib.machinery import ModuleSpec
|
|
169
169
|
from inspect import getinnerframes, getouterframes, getsourcefile
|
|
170
170
|
from types import ModuleType
|
|
171
|
-
from typing import Any, Callable, Generator, Iterable, Optional, Union, cast
|
|
171
|
+
from typing import Any, Callable, Generator, Iterable, MutableMapping, Optional, Union, cast
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
__version__ = '0.3.
|
|
174
|
+
__version__ = '0.3.59'
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
os_path_abspath = os.path.abspath
|
|
@@ -633,33 +633,34 @@ def load_dotenvs():
|
|
|
633
633
|
|
|
634
634
|
.. hint:: call from the main module of project/app in order to also load ``.env`` files in/above the project folder.
|
|
635
635
|
"""
|
|
636
|
-
|
|
636
|
+
env_vars = os.environ
|
|
637
|
+
load_env_var_defaults(os.getcwd(), env_vars)
|
|
637
638
|
if file_name := stack_var('__file__'):
|
|
638
|
-
load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)))
|
|
639
|
+
load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)), env_vars)
|
|
639
640
|
|
|
640
641
|
|
|
641
|
-
def load_env_var_defaults(start_dir: str):
|
|
642
|
-
"""
|
|
642
|
+
def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]):
|
|
643
|
+
""" load undeclared env var defaults from a chain of ``.env`` files starting in the specified folder or its parent.
|
|
643
644
|
|
|
644
|
-
:param start_dir: folder to start search of an ``.env`` file, if not found, then checks the parent
|
|
645
|
-
if
|
|
646
|
-
into
|
|
645
|
+
:param start_dir: folder to start search of an ``.env`` file, if not found, then also checks the parent
|
|
646
|
+
folder. if an ``.env `` file got found, then put their shell environment variable values
|
|
647
|
+
into the specified :paramref:`~load_env_var_defaults.env_vars` mapping if they are not
|
|
648
|
+
already there. after processing the first ``.env`` file, it repeats to check for
|
|
647
649
|
further ``.env`` files in the parent folder to load them too, until either detecting
|
|
648
650
|
a folder without an ``.env`` file or until an ``.env`` got loaded from the root folder.
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
value specified in the ``.env`` file to be loaded). the variable values declared in the subfolders
|
|
653
|
-
are having preference over the values declared in the parent folders.
|
|
651
|
+
:param env_vars: environment variables mapping to be amended with env variable values from any
|
|
652
|
+
found ``.env`` file. pass Python's :data:`os.environ` to amend this mapping directly
|
|
653
|
+
with all the already not declared environment variables.
|
|
654
654
|
"""
|
|
655
|
-
|
|
655
|
+
start_dir = norm_path(start_dir)
|
|
656
|
+
file_path = os_path_join(start_dir, DOTENV_FILE_NAME)
|
|
656
657
|
if not os_path_isfile(file_path):
|
|
657
658
|
file_path = os_path_join(os_path_dirname(start_dir), DOTENV_FILE_NAME)
|
|
658
659
|
|
|
659
660
|
while os_path_isfile(file_path):
|
|
660
661
|
for var_nam, var_val in parse_dotenv(file_path).items():
|
|
661
|
-
if var_nam not in
|
|
662
|
-
|
|
662
|
+
if var_nam not in env_vars:
|
|
663
|
+
env_vars[var_nam] = var_val
|
|
663
664
|
|
|
664
665
|
if os.sep not in file_path:
|
|
665
666
|
break # pragma: no cover # prevent endless-loop for ``.env`` file in root dir (os.sep == '/')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_base
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.59
|
|
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,19 +67,19 @@ 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 V0.3.
|
|
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.59
|
|
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.57)
|
|
79
79
|
[](
|
|
80
80
|
https://pypi.org/project/ae-base/#history)
|
|
81
81
|
|
|
82
|
-
>
|
|
82
|
+
>ae namespace module portion base: basic constants, helper functions and context manager.
|
|
83
83
|
|
|
84
84
|
[](
|
|
85
85
|
https://ae-group.gitlab.io/ae_base/coverage/index.html)
|
ae_base-0.3.59/setup.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_project V0.3.35
|
|
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.59\n\n[](\n https://gitlab.com/ae-group/ae_base)\n[](\n https://gitlab.com/ae-group/ae_base/-/tree/release0.3.57)\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.59',
|
|
28
|
+
'zip_safe': True,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if __name__ == "__main__":
|
|
32
|
+
setuptools.setup(**setup_kwargs)
|
|
33
|
+
pass
|
|
@@ -489,43 +489,71 @@ class TestBaseHelpers:
|
|
|
489
489
|
load_dotenvs()
|
|
490
490
|
assert env_var_name not in os.environ
|
|
491
491
|
|
|
492
|
-
def
|
|
492
|
+
def test_load_env_var_defaults_errors(self):
|
|
493
|
+
with pytest.raises(TypeError):
|
|
494
|
+
# noinspection PyArgumentList
|
|
495
|
+
load_env_var_defaults()
|
|
496
|
+
|
|
497
|
+
with pytest.raises(TypeError):
|
|
498
|
+
# noinspection PyTypeChecker
|
|
499
|
+
load_env_var_defaults(None, None) # STRANGE: raising TypeError in Python 3.9.21/local but not in 3.9.23/CI
|
|
500
|
+
# noinspection PyArgumentList
|
|
501
|
+
load_env_var_defaults(None) # HOTFIX ensuring failure - could not find any changelog notes )
|
|
502
|
+
|
|
503
|
+
# noinspection PyTypeChecker
|
|
504
|
+
load_env_var_defaults("inv:_ file path", ()) # NO ERROR EXCEPTIONS on these invalid arg values!!!
|
|
505
|
+
|
|
506
|
+
def test_load_env_var_defaults_not_loaded(self):
|
|
507
|
+
env_vars = {}
|
|
508
|
+
|
|
509
|
+
load_env_var_defaults('/', env_vars)
|
|
510
|
+
assert env_var_name not in env_vars
|
|
511
|
+
|
|
512
|
+
load_env_var_defaults('.', env_vars)
|
|
513
|
+
assert env_var_name not in env_vars
|
|
514
|
+
|
|
515
|
+
def test_load_env_var_defaults_not_loaded_in_os_environ(self, os_env_test_env):
|
|
493
516
|
assert env_var_name not in os.environ
|
|
494
517
|
|
|
495
|
-
load_env_var_defaults('/')
|
|
518
|
+
load_env_var_defaults('/', os.environ)
|
|
496
519
|
assert env_var_name not in os.environ
|
|
497
520
|
|
|
498
|
-
load_env_var_defaults('.')
|
|
521
|
+
load_env_var_defaults('.', os.environ)
|
|
499
522
|
assert env_var_name not in os.environ
|
|
500
523
|
|
|
501
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 5)))
|
|
524
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 5)), os.environ)
|
|
502
525
|
assert env_var_name not in os.environ
|
|
503
526
|
|
|
504
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 6)))
|
|
527
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 6)), os.environ) # too-deep path
|
|
505
528
|
assert env_var_name not in os.environ
|
|
506
529
|
|
|
507
530
|
def test_load_env_var_defaults_load_start_parent_first_no_chain(self, os_env_test_env):
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
531
|
+
old_cwd = os.getcwd()
|
|
532
|
+
try:
|
|
533
|
+
os.chdir(os.path.join(os_env_test_env, *((folder_name, ) * 4)))
|
|
534
|
+
load_env_var_defaults("", os.environ)
|
|
535
|
+
assert env_var_name in os.environ
|
|
536
|
+
assert os.environ[env_var_name] == env_var_val + '3'
|
|
537
|
+
finally:
|
|
538
|
+
os.chdir(old_cwd)
|
|
511
539
|
|
|
512
540
|
def test_load_env_var_defaults_load_start_first_no_chain(self, os_env_test_env):
|
|
513
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 3)))
|
|
541
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 3)), os.environ)
|
|
514
542
|
assert env_var_name in os.environ
|
|
515
543
|
assert os.environ[env_var_name] == env_var_val + '3'
|
|
516
544
|
|
|
517
545
|
def test_load_env_var_defaults_load_start_parent_first_in_chain(self, os_env_test_env):
|
|
518
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 2)))
|
|
546
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 2)), os.environ)
|
|
519
547
|
assert env_var_name in os.environ
|
|
520
548
|
assert os.environ[env_var_name] == env_var_val + '1'
|
|
521
549
|
|
|
522
550
|
def test_load_env_var_defaults_load_start_no_parent_first_in_chain(self, os_env_test_env):
|
|
523
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 1)))
|
|
551
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 1)), os.environ)
|
|
524
552
|
assert env_var_name in os.environ
|
|
525
553
|
assert os.environ[env_var_name] == env_var_val + '1'
|
|
526
554
|
|
|
527
555
|
def test_load_env_var_defaults_load_start_on_second_within_chain(self, os_env_test_env):
|
|
528
|
-
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 0)))
|
|
556
|
+
load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 0)), os.environ)
|
|
529
557
|
assert env_var_name in os.environ
|
|
530
558
|
assert os.environ[env_var_name] == env_var_val + '0'
|
|
531
559
|
|
|
@@ -687,12 +715,20 @@ class TestBaseHelpers:
|
|
|
687
715
|
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
688
716
|
fp.write('declaredVar = DeclaredValue\n')
|
|
689
717
|
fp.write('replacedVar = beforeTheDollar$declaredVar\n')
|
|
690
|
-
fp.write('uncutVar
|
|
718
|
+
fp.write('uncutVar=beforeTheDollar$afterTheDollar\n')
|
|
691
719
|
fp.seek(0)
|
|
692
720
|
loaded = parse_dotenv(fp.name)
|
|
693
721
|
assert loaded['replacedVar'] == "beforeTheDollarDeclaredValue"
|
|
694
722
|
assert loaded['uncutVar'] == "beforeTheDollar$afterTheDollar"
|
|
695
723
|
|
|
724
|
+
def test_parse_dotenv_double_in_single_value(self):
|
|
725
|
+
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
726
|
+
fp.write("""var_nam='"var val"'""")
|
|
727
|
+
fp.seek(0)
|
|
728
|
+
loaded = parse_dotenv(fp.name)
|
|
729
|
+
assert 'var_nam' in loaded
|
|
730
|
+
assert loaded['var_nam'] == '"var val"'
|
|
731
|
+
|
|
696
732
|
def test_parse_dotenv_double_quoted_value(self):
|
|
697
733
|
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
698
734
|
fp.write('var_nam="var val"')
|
|
@@ -708,6 +744,14 @@ class TestBaseHelpers:
|
|
|
708
744
|
loaded = parse_dotenv(fp.name)
|
|
709
745
|
assert 'var_nam' not in loaded # added warning
|
|
710
746
|
|
|
747
|
+
def test_parse_dotenv_single_in_double_quoted_value(self):
|
|
748
|
+
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
749
|
+
fp.write('''var_nam="'var val'"''')
|
|
750
|
+
fp.seek(0)
|
|
751
|
+
loaded = parse_dotenv(fp.name)
|
|
752
|
+
assert 'var_nam' in loaded
|
|
753
|
+
assert loaded['var_nam'] == "'var val'"
|
|
754
|
+
|
|
711
755
|
def test_parse_dotenv_single_value(self):
|
|
712
756
|
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
713
757
|
fp.write("var_nam='var val'")
|
|
@@ -716,6 +760,24 @@ class TestBaseHelpers:
|
|
|
716
760
|
assert 'var_nam' in loaded
|
|
717
761
|
assert loaded['var_nam'] == "var val"
|
|
718
762
|
|
|
763
|
+
def test_parse_dotenv_literal_dict_with_list(self):
|
|
764
|
+
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
765
|
+
var_val = "{'key': {'sub-key': ['list-item', 'list-item with = char', ]}}"
|
|
766
|
+
fp.write("var_nam=" + var_val)
|
|
767
|
+
fp.seek(0)
|
|
768
|
+
loaded = parse_dotenv(fp.name)
|
|
769
|
+
assert 'var_nam' in loaded
|
|
770
|
+
assert loaded['var_nam'] == var_val
|
|
771
|
+
|
|
772
|
+
def test_parse_dotenv_literal_dict_with_list_quoted(self):
|
|
773
|
+
with tempfile.NamedTemporaryFile(mode="w") as fp:
|
|
774
|
+
var_val = "{'key': {'sub-key': ['list-item', 'list-item with = char']}}"
|
|
775
|
+
fp.write('var_nam="' + var_val + '"')
|
|
776
|
+
fp.seek(0)
|
|
777
|
+
loaded = parse_dotenv(fp.name)
|
|
778
|
+
assert 'var_nam' in loaded
|
|
779
|
+
assert loaded['var_nam'] == var_val
|
|
780
|
+
|
|
719
781
|
def test_parse_dotenv_start_parent_first_in_chain(self, os_env_test_env):
|
|
720
782
|
assert env_var_name not in os.environ
|
|
721
783
|
file_path = os.path.join(os_env_test_env, folder_name, DOTENV_FILE_NAME)
|
ae_base-0.3.56/setup.py
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_project V0.3.32
|
|
2
|
-
""" setup this project with setuptools and aedev.setup_project. """
|
|
3
|
-
import pprint
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
import setuptools
|
|
7
|
-
|
|
8
|
-
from aedev.setup_project import project_env_vars # type: ignore
|
|
9
|
-
|
|
10
|
-
pev = project_env_vars(from_setup=True)
|
|
11
|
-
|
|
12
|
-
if __name__ == "__main__":
|
|
13
|
-
print("# EXECUTING SETUPTOOLS SETUP: argv, kwargs ###################")
|
|
14
|
-
print(pprint.pformat(sys.argv, indent=3, width=75, compact=True))
|
|
15
|
-
setup_kwargs = pev['setup_kwargs']
|
|
16
|
-
print(pprint.pformat(setup_kwargs, indent=3, width=75, compact=True))
|
|
17
|
-
setuptools.setup(**setup_kwargs)
|
|
18
|
-
print("# FINISHED SETUPTOOLS SETUP ##################################")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|