appsettings2 2.1.1__tar.gz → 2.1.3__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.
Files changed (26) hide show
  1. {appsettings2-2.1.1/src/appsettings2.egg-info → appsettings2-2.1.3}/PKG-INFO +3 -7
  2. {appsettings2-2.1.1 → appsettings2-2.1.3}/pyproject.toml +6 -26
  3. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/ConfigurationBuilder.py +1 -1
  4. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/SKILL.md +2 -0
  5. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/__init__.py +2 -2
  6. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/helpers.py +1 -1
  7. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/EnvironmentConfigurationProvider.py +7 -0
  8. {appsettings2-2.1.1 → appsettings2-2.1.3/src/appsettings2.egg-info}/PKG-INFO +3 -7
  9. appsettings2-2.1.3/src/appsettings2.egg-info/requires.txt +7 -0
  10. appsettings2-2.1.1/src/appsettings2.egg-info/requires.txt +0 -11
  11. {appsettings2-2.1.1 → appsettings2-2.1.3}/LICENSE +0 -0
  12. {appsettings2-2.1.1 → appsettings2-2.1.3}/README.md +0 -0
  13. {appsettings2-2.1.1 → appsettings2-2.1.3}/setup.cfg +0 -0
  14. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/Configuration.py +0 -0
  15. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/ConfigurationException.py +0 -0
  16. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/ConfigurationWatcher.py +0 -0
  17. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/CommandLineConfigurationProvider.py +0 -0
  18. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/ConfigurationProvider.py +0 -0
  19. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/JsonConfigurationProvider.py +0 -0
  20. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/TomlConfigurationProvider.py +0 -0
  21. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/YamlConfigurationProvider.py +0 -0
  22. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/providers/__init__.py +0 -0
  23. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2/py.typed +0 -0
  24. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2.egg-info/SOURCES.txt +0 -0
  25. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2.egg-info/dependency_links.txt +0 -0
  26. {appsettings2-2.1.1 → appsettings2-2.1.3}/src/appsettings2.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: appsettings2
3
- Version: 2.1.1
4
- Summary: Unifies configuration sources into a Configuration object that can be bound to complex types, or accessed directly for configuration data.
3
+ Version: 2.1.3
4
+ Summary: ..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Documentation, https://appsettings2.readthedocs.io/
@@ -17,12 +17,8 @@ License-File: LICENSE
17
17
  Requires-Dist: pyyaml>=6.0.3
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: coverage; extra == "dev"
20
- Requires-Dist: flake8; extra == "dev"
21
- Requires-Dist: flake8-pyproject; extra == "dev"
22
20
  Requires-Dist: mypy; extra == "dev"
23
- Requires-Dist: pep8-naming; extra == "dev"
24
- Requires-Dist: punit>=1.12.5; extra == "dev"
25
- Requires-Dist: twine; extra == "dev"
21
+ Requires-Dist: punit>=1.14.2; extra == "dev"
26
22
  Requires-Dist: types-PyYAML; extra == "dev"
27
23
  Dynamic: license-file
28
24
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "appsettings2"
3
- version = "2.1.1"
4
- description = "Unifies configuration sources into a Configuration object that can be bound to complex types, or accessed directly for configuration data."
3
+ version = "2.1.3"
4
+ description = "..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data."
5
5
  keywords = ["appsettings", "configuration"]
6
6
  authors = [
7
7
  { name="Shaun Wilson", email="mrshaunwilson@msn.com" }
@@ -15,18 +15,14 @@ classifiers = [
15
15
  ]
16
16
  requires-python = ">=3.11"
17
17
  dependencies = [
18
- "pyyaml>=6.0.3"
18
+ "pyyaml (>=6.0.3)"
19
19
  ]
20
20
 
21
21
  [project.optional-dependencies]
22
22
  dev = [
23
23
  "coverage",
24
- "flake8",
25
- "flake8-pyproject",
26
24
  "mypy",
27
- "pep8-naming",
28
- "punit (>=1.12.5)",
29
- "twine",
25
+ "punit (>=1.14.2)",
30
26
  "types-PyYAML"
31
27
  ]
32
28
 
@@ -35,24 +31,8 @@ Documentation = "https://appsettings2.readthedocs.io/"
35
31
  Homepage = "https://github.com/wilson0x4d/appsettings2"
36
32
  Repository = "https://github.com/wilson0x4d/appsettings2.git"
37
33
 
38
- [build-system]
39
- requires = ["setuptools"]
40
- build-backend = "setuptools.build_meta"
41
-
42
- [tool.setuptools.packages.find]
43
- where = ["src"]
44
- exclude = [
45
- "docs",
46
- "tests",
47
- "tests.*"
48
- ]
49
-
50
34
  [tool.setuptools.package-data]
51
35
  "appsettings2" = ["py.typed", "SKILL.md"]
52
36
 
53
- [tool.flake8]
54
- max-line-length = 120
55
- ignore = ["D100","E501"]
56
- per-file-ignores = [
57
- "tests/*.py:D012,E306",
58
- ]
37
+ [tool.uv]
38
+ package = true
@@ -76,7 +76,7 @@ class ConfigurationBuilder:
76
76
  """
77
77
  Add a :py:class:`~appsettings2.providers.EnvironmentConfigurationProvider`.
78
78
 
79
- :param required_prefix: Optional prefix used to filter which environment variables are included. Only variables whose names start with this prefix (followed by ``_`` or ``__``) will be loaded. When ``None``, all environment variables are included. Defaults to None.
79
+ :param required_prefix: Optional prefix used to filter which environment variables are included. Only variables whose names start with this prefix (followed by ``_`` or ``__``) will be loaded. When ``None``, all environment variables are included. Defaults to None. Note that environment variables whose names begin with an underscore are unsupported and are always ignored, even when ``required_prefix`` matches them.
80
80
  :return: Returns :py:class:`~appsettings2.ConfigurationBuilder` for method chaining.
81
81
  """
82
82
  return self.add_provider(EnvironmentConfigurationProvider(required_prefix=required_prefix))
@@ -82,6 +82,8 @@ export MYAPP_DB_HOST=postgres://... # loaded as "DB_HOST"
82
82
  export OTHER_KEY=value # ignored
83
83
  ```
84
84
 
85
+ Env vars whose names begin with an underscore (e.g. `_FOO`, `__FOO`) are unsupported and are always ignored, even when `required_prefix` is set to a matching value. This prevents double-underscore-prefixed variables from producing an unwanted empty (`''`) hierarchy key.
86
+
85
87
  ### `build()`
86
88
 
87
89
  ```python
@@ -11,8 +11,8 @@ from . import helpers
11
11
  from . import providers
12
12
 
13
13
 
14
- __version__ = '2.1.1'
15
- __commit__ = 'ec3a50a'
14
+ __version__ = '2.1.3'
15
+ __commit__ = '7215742'
16
16
  __all__ = [
17
17
  '__version__', '__commit__',
18
18
  'Configuration',
@@ -30,7 +30,7 @@ def get_configuration(
30
30
  :param cli: ``True`` to load configuration from Command-Line, defaults to True
31
31
  :param environment: ``True`` to load configuration from process Environment, defaults to True
32
32
  :param variations: A set of variations to apply to use with file-based Configuration Providers, defaults to ['', 'prod', 'production', 'stage', 'staging', 'qa', 'dev', 'development', 'local']
33
- :param env_prefix: (OPTIONAL) When specified, only env vars having the specified prefix are bound as configuration settings, the prefix is stripped from the resulting setting name.
33
+ :param env_prefix: (OPTIONAL) When specified, only env vars having the specified prefix are bound as configuration settings, the prefix is stripped from the resulting setting name. Env vars whose names begin with an underscore are unsupported and are always ignored, even when they match ``env_prefix``.
34
34
  :param disable_events: Option indicating whether change events should be emitted, defaults to False.
35
35
  :return: An ``appsettings2.Configuration`` instance.
36
36
  """
@@ -33,8 +33,15 @@ class EnvironmentConfigurationProvider(ConfigurationProvider):
33
33
 
34
34
  When ``required_prefix`` is set, only keys starting with that prefix are included,
35
35
  and the prefix is stripped from each key in the output configuration.
36
+
37
+ Environment variable names starting with an underscore (e.g. ``_FOO``,
38
+ ``__FOO``) are unsupported and are always ignored, even when they match
39
+ ``required_prefix``. This prevents double-underscore-prefixed variables
40
+ from producing empty (``''``) hierarchy keys.
36
41
  """
37
42
  for k in os.environ:
43
+ if k.startswith('_'):
44
+ continue
38
45
  key = (
39
46
  k
40
47
  if self.__required_prefix is None
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: appsettings2
3
- Version: 2.1.1
4
- Summary: Unifies configuration sources into a Configuration object that can be bound to complex types, or accessed directly for configuration data.
3
+ Version: 2.1.3
4
+ Summary: ..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Documentation, https://appsettings2.readthedocs.io/
@@ -17,12 +17,8 @@ License-File: LICENSE
17
17
  Requires-Dist: pyyaml>=6.0.3
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: coverage; extra == "dev"
20
- Requires-Dist: flake8; extra == "dev"
21
- Requires-Dist: flake8-pyproject; extra == "dev"
22
20
  Requires-Dist: mypy; extra == "dev"
23
- Requires-Dist: pep8-naming; extra == "dev"
24
- Requires-Dist: punit>=1.12.5; extra == "dev"
25
- Requires-Dist: twine; extra == "dev"
21
+ Requires-Dist: punit>=1.14.2; extra == "dev"
26
22
  Requires-Dist: types-PyYAML; extra == "dev"
27
23
  Dynamic: license-file
28
24
 
@@ -0,0 +1,7 @@
1
+ pyyaml>=6.0.3
2
+
3
+ [dev]
4
+ coverage
5
+ mypy
6
+ punit>=1.14.2
7
+ types-PyYAML
@@ -1,11 +0,0 @@
1
- pyyaml>=6.0.3
2
-
3
- [dev]
4
- coverage
5
- flake8
6
- flake8-pyproject
7
- mypy
8
- pep8-naming
9
- punit>=1.12.5
10
- twine
11
- types-PyYAML
File without changes
File without changes
File without changes