ae-base 0.3.61__tar.gz → 0.3.63__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_base
3
- Version: 0.3.61
3
+ Version: 0.3.63
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
@@ -69,13 +69,13 @@ Dynamic: summary
69
69
 
70
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.61
72
+ # base 0.3.63
73
73
 
74
74
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
75
75
  https://gitlab.com/ae-group/ae_base)
76
76
  [![LatestPyPIrelease](
77
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.60?logo=python)](
78
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.60)
77
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.61?logo=python)](
78
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.61)
79
79
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
80
80
  https://pypi.org/project/ae-base/#history)
81
81
 
@@ -1,12 +1,12 @@
1
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.61
3
+ # base 0.3.63
4
4
 
5
5
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
6
6
  https://gitlab.com/ae-group/ae_base)
7
7
  [![LatestPyPIrelease](
8
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.60?logo=python)](
9
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.60)
8
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.61?logo=python)](
9
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.61)
10
10
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
11
11
  https://pypi.org/project/ae-base/#history)
12
12
 
@@ -171,7 +171,7 @@ from types import ModuleType
171
171
  from typing import Any, Callable, Generator, Iterable, MutableMapping, Optional, Union, cast
172
172
 
173
173
 
174
- __version__ = '0.3.61'
174
+ __version__ = '0.3.63'
175
175
 
176
176
 
177
177
  os_path_abspath = os.path.abspath
@@ -641,7 +641,7 @@ def load_dotenvs():
641
641
  load_env_var_defaults(os_path_dirname(os_path_abspath(file_name)), env_vars)
642
642
 
643
643
 
644
- def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]):
644
+ def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]) -> MutableMapping[str, str]:
645
645
  """ load undeclared env var defaults from a chain of ``.env`` files starting in the specified folder or its parent.
646
646
 
647
647
  :param start_dir: folder to start search of an ``.env`` file, if not found, then also checks the parent
@@ -653,21 +653,25 @@ def load_env_var_defaults(start_dir: str, env_vars: MutableMapping[str, str]):
653
653
  :param env_vars: environment variables mapping to be amended with env variable values from any
654
654
  found ``.env`` file. pass Python's :data:`os.environ` to amend this mapping directly
655
655
  with all the already not declared environment variables.
656
+ :return: dict with the loaded env var names (keys) and values.
656
657
  """
657
658
  start_dir = norm_path(start_dir)
658
659
  file_path = os_path_join(start_dir, DOTENV_FILE_NAME)
659
660
  if not os_path_isfile(file_path):
660
661
  file_path = os_path_join(os_path_dirname(start_dir), DOTENV_FILE_NAME)
661
662
 
663
+ loaded_vars = {}
662
664
  while os_path_isfile(file_path):
663
665
  for var_nam, var_val in parse_dotenv(file_path).items():
664
666
  if var_nam not in env_vars:
665
- env_vars[var_nam] = var_val
667
+ env_vars[var_nam] = loaded_vars[var_nam] = var_val
666
668
 
667
669
  if os.sep not in file_path:
668
670
  break # pragma: no cover # prevent endless-loop for ``.env`` file in root dir (os.sep == '/')
669
671
  file_path = os_path_join(os_path_dirname(os_path_dirname(file_path)), DOTENV_FILE_NAME)
670
672
 
673
+ return loaded_vars
674
+
671
675
 
672
676
  def main_file_paths_parts(portion_name: str) -> tuple[tuple[str, ...], ...]:
673
677
  """ determine tuple of supported main/version file name path part tuples.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ae_base
3
- Version: 0.3.61
3
+ Version: 0.3.63
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
@@ -69,13 +69,13 @@ Dynamic: summary
69
69
 
70
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.61
72
+ # base 0.3.63
73
73
 
74
74
  [![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](
75
75
  https://gitlab.com/ae-group/ae_base)
76
76
  [![LatestPyPIrelease](
77
- https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.60?logo=python)](
78
- https://gitlab.com/ae-group/ae_base/-/tree/release0.3.60)
77
+ https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.61?logo=python)](
78
+ https://gitlab.com/ae-group/ae_base/-/tree/release0.3.61)
79
79
  [![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](
80
80
  https://pypi.org/project/ae-base/#history)
81
81
 
@@ -15,7 +15,7 @@ setup_kwargs = {
15
15
  'install_requires': [],
16
16
  'keywords': ['configuration', 'development', 'environment', 'productivity'],
17
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.61\n\n[![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](\n https://gitlab.com/ae-group/ae_base)\n[![LatestPyPIrelease](\n https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.60?logo=python)](\n https://gitlab.com/ae-group/ae_base/-/tree/release0.3.60)\n[![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](\n https://pypi.org/project/ae-base/#history)\n\n>ae namespace module portion base: basic constants, helper functions and context manager.\n\n[![Coverage](https://ae-group.gitlab.io/ae_base/coverage.svg)](\n https://ae-group.gitlab.io/ae_base/coverage/index.html)\n[![MyPyPrecision](https://ae-group.gitlab.io/ae_base/mypy.svg)](\n https://ae-group.gitlab.io/ae_base/lineprecision.txt)\n[![PyLintScore](https://ae-group.gitlab.io/ae_base/pylint.svg)](\n https://ae-group.gitlab.io/ae_base/pylint.log)\n\n[![PyPIImplementation](https://img.shields.io/pypi/implementation/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIPyVersions](https://img.shields.io/pypi/pyversions/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIWheel](https://img.shields.io/pypi/wheel/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIFormat](https://img.shields.io/pypi/format/ae_base)](\n https://pypi.org/project/ae-base/)\n[![PyPILicense](https://img.shields.io/pypi/l/ae_base)](\n https://gitlab.com/ae-group/ae_base/-/blob/develop/LICENSE.md)\n[![PyPIStatus](https://img.shields.io/pypi/status/ae_base)](\n https://libraries.io/pypi/ae-base)\n[![PyPIDownloads](https://img.shields.io/pypi/dm/ae_base)](\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',
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.63\n\n[![GitLab develop](https://img.shields.io/gitlab/pipeline/ae-group/ae_base/develop?logo=python)](\n https://gitlab.com/ae-group/ae_base)\n[![LatestPyPIrelease](\n https://img.shields.io/gitlab/pipeline/ae-group/ae_base/release0.3.61?logo=python)](\n https://gitlab.com/ae-group/ae_base/-/tree/release0.3.61)\n[![PyPIVersions](https://img.shields.io/pypi/v/ae_base)](\n https://pypi.org/project/ae-base/#history)\n\n>ae namespace module portion base: basic constants, helper functions and context manager.\n\n[![Coverage](https://ae-group.gitlab.io/ae_base/coverage.svg)](\n https://ae-group.gitlab.io/ae_base/coverage/index.html)\n[![MyPyPrecision](https://ae-group.gitlab.io/ae_base/mypy.svg)](\n https://ae-group.gitlab.io/ae_base/lineprecision.txt)\n[![PyLintScore](https://ae-group.gitlab.io/ae_base/pylint.svg)](\n https://ae-group.gitlab.io/ae_base/pylint.log)\n\n[![PyPIImplementation](https://img.shields.io/pypi/implementation/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIPyVersions](https://img.shields.io/pypi/pyversions/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIWheel](https://img.shields.io/pypi/wheel/ae_base)](\n https://gitlab.com/ae-group/ae_base/)\n[![PyPIFormat](https://img.shields.io/pypi/format/ae_base)](\n https://pypi.org/project/ae-base/)\n[![PyPILicense](https://img.shields.io/pypi/l/ae_base)](\n https://gitlab.com/ae-group/ae_base/-/blob/develop/LICENSE.md)\n[![PyPIStatus](https://img.shields.io/pypi/status/ae_base)](\n https://libraries.io/pypi/ae-base)\n[![PyPIDownloads](https://img.shields.io/pypi/dm/ae_base)](\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
19
  'long_description_content_type': 'text/markdown',
20
20
  'name': 'ae_base',
21
21
  'package_data': {'': []},
@@ -24,7 +24,7 @@ setup_kwargs = {
24
24
  'python_requires': '>=3.9',
25
25
  'setup_requires': ['aedev_setup_project'],
26
26
  'url': 'https://gitlab.com/ae-group/ae_base',
27
- 'version': '0.3.61',
27
+ 'version': '0.3.63',
28
28
  'zip_safe': True,
29
29
  }
30
30
 
@@ -526,7 +526,7 @@ class TestBaseHelpers:
526
526
  # noinspection PyTypeChecker
527
527
  load_env_var_defaults(None, None) # STRANGE: raising TypeError in Python 3.9.21/local but not in 3.9.23/CI
528
528
  # noinspection PyArgumentList
529
- load_env_var_defaults(None) # HOTFIX ensuring failure - could not find any changelog notes )
529
+ load_env_var_defaults(None) # HOTFIX ensuring failure - could not find any changelog notes
530
530
 
531
531
  # noinspection PyTypeChecker
532
532
  load_env_var_defaults("inv:_ file path", ()) # NO ERROR EXCEPTIONS on these invalid arg values!!!
@@ -559,29 +559,34 @@ class TestBaseHelpers:
559
559
  old_cwd = os.getcwd()
560
560
  try:
561
561
  os.chdir(os.path.join(os_env_test_env, *((folder_name, ) * 4)))
562
- load_env_var_defaults("", os.environ)
562
+ loaded = load_env_var_defaults("", os.environ)
563
+ assert loaded == {'env_var_nam1': env_var_val + '3'}
563
564
  assert env_var_name in os.environ
564
565
  assert os.environ[env_var_name] == env_var_val + '3'
565
566
  finally:
566
567
  os.chdir(old_cwd)
567
568
 
568
569
  def test_load_env_var_defaults_load_start_first_no_chain(self, os_env_test_env):
569
- load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 3)), os.environ)
570
+ loaded = load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 3)), os.environ)
571
+ assert loaded == {'env_var_nam1': env_var_val + '3'}
570
572
  assert env_var_name in os.environ
571
573
  assert os.environ[env_var_name] == env_var_val + '3'
572
574
 
573
575
  def test_load_env_var_defaults_load_start_parent_first_in_chain(self, os_env_test_env):
574
- load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 2)), os.environ)
576
+ loaded = load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 2)), os.environ)
577
+ assert loaded == {'env_var_nam1': env_var_val + '1'}
575
578
  assert env_var_name in os.environ
576
579
  assert os.environ[env_var_name] == env_var_val + '1'
577
580
 
578
581
  def test_load_env_var_defaults_load_start_no_parent_first_in_chain(self, os_env_test_env):
579
- load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 1)), os.environ)
582
+ loaded = load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 1)), os.environ)
583
+ assert loaded == {'env_var_nam1': env_var_val + '1'}
580
584
  assert env_var_name in os.environ
581
585
  assert os.environ[env_var_name] == env_var_val + '1'
582
586
 
583
587
  def test_load_env_var_defaults_load_start_on_second_within_chain(self, os_env_test_env):
584
- load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 0)), os.environ)
588
+ loaded = load_env_var_defaults(os.path.join(os_env_test_env, *((folder_name, ) * 0)), os.environ)
589
+ assert loaded == {'env_var_nam1': env_var_val + '0'}
585
590
  assert env_var_name in os.environ
586
591
  assert os.environ[env_var_name] == env_var_val + '0'
587
592
 
File without changes
File without changes