dotenvmodel 0.6.2__tar.gz → 0.6.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.
- dotenvmodel-0.6.3/.release-please-manifest.json +3 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/CHANGELOG.md +7 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/PKG-INFO +1 -1
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/loading.md +2 -2
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/__init__.py +1 -1
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/config.py +3 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/pyproject.toml +1 -1
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_cached.py +22 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/uv.lock +1 -1
- dotenvmodel-0.6.2/.release-please-manifest.json +0 -3
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/CODEOWNERS +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/dependabot.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/pull_request_template.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/workflows/ci.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/workflows/docs.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/workflows/publish.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.github/workflows/release-please.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.gitignore +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/.python-version +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/CODE_OF_CONDUCT.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/CONTRIBUTING.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/LICENSE +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/Makefile +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/README.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/SECURITY.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/caching.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/coercion.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/config.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/constants.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/describe-formatters.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/describe-renderers.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/describe.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/dotenvmodel.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/exceptions.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/fields.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/loading.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/logging-config.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/metaclass.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/types.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/api-reference/validation.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/changelog.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/examples/complete-app.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/getting-started/installation.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/getting-started/quick-start.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/configuration-docs.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/error-handling.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/fields.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/logging.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/prefixes.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/types.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/guides/validation.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/docs/index.md +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/_constants.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/_redaction.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/caching.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/coercion.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/describe/__init__.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/describe/formatters.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/describe/renderers.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/exceptions.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/fields.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/loading.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/logging_config.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/metaclass.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/py.typed +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/types.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/dotenvmodel/validation.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/examples/advanced_types.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/examples/basic_usage.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/examples/describe_documentation.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/examples/generate_env_example.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/examples/logging_example.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/mkdocs.yml +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/release-please-config.json +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/__init__.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/conftest.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_basic.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_coercion.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_collection_validators.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_defaults_coercion.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_describe.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_adoption.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_datetime.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_describe_output.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_enum.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_field_options.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_numbers.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_path_options.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_edge_strings.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_empty_collection_items.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_empty_strings.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_enum.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_errors.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_field_constraints.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_future_annotations.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_inheritance.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_json.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_json_and_optional.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_loading.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_logging_config.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_nested_config.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_post_load.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_prefix.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_reload.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_secret_redaction.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_secretstr_security.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_string_affixes.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_strip.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_strip_integration.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_types.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_union_types.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_url_dsn.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_url_password_decoding.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_url_unquote.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_urls.py +0 -0
- {dotenvmodel-0.6.2 → dotenvmodel-0.6.3}/tests/test_validator.py +0 -0
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.3](https://github.com/AZX-PBC-OSS/dotenvmodel/compare/v0.6.2...v0.6.3) (2026-07-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* reload() must update the instance's recorded load arguments ([#56](https://github.com/AZX-PBC-OSS/dotenvmodel/issues/56)) ([a293461](https://github.com/AZX-PBC-OSS/dotenvmodel/commit/a2934612da52130cc539be65bd1fe196a4381dde))
|
|
14
|
+
|
|
8
15
|
## [0.6.2](https://github.com/AZX-PBC-OSS/dotenvmodel/compare/v0.6.1...v0.6.2) (2026-07-28)
|
|
9
16
|
|
|
10
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dotenvmodel
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Type-safe environment configuration with automatic .env file loading
|
|
5
5
|
Project-URL: Homepage, https://github.com/AZX-PBC-OSS/dotenvmodel
|
|
6
6
|
Project-URL: Repository, https://github.com/AZX-PBC-OSS/dotenvmodel
|
|
@@ -222,9 +222,9 @@ assert config is same_config
|
|
|
222
222
|
|
|
223
223
|
`cached()` is lazy — the environment is only read on the very first call. It is also thread-safe: if multiple threads call `cached()` simultaneously before the first load completes, they race on a lock and only one thread calls `load()`; the rest block and receive the same instance. Once the cache is warm, all calls return immediately without acquiring the lock.
|
|
224
224
|
|
|
225
|
-
Arguments (`env`, `override`, `env_dir`) are only used on the first call. Once the instance is cached, subsequent calls ignore any arguments and return the existing instance. A warning is logged
|
|
225
|
+
Arguments (`env`, `override`, `env_dir`) are only used on the first call. Once the instance is cached, subsequent calls ignore any arguments and return the existing instance. A warning is logged when the arguments passed disagree with the ones the cached instance was loaded with — so an accessor that consistently passes the same non-default arguments (`override=False`, say) stays silent, while a caller asking for something the cache does not hold is told what it actually holds.
|
|
226
226
|
|
|
227
|
-
Calling `.reload()` on the cached instance mutates it in place; since `cached()` always returns the same object, subsequent `cached()` calls see the reloaded values.
|
|
227
|
+
Calling `.reload()` on the cached instance mutates it in place; since `cached()` always returns the same object, subsequent `cached()` calls see the reloaded values. A reload also updates what the instance reports as its load arguments, so `reload(env="prod")` is reflected by both `loaded_with()` and the comparison above.
|
|
228
228
|
|
|
229
229
|
!!! warning "Reentrant `cached()` calls raise `RuntimeError`"
|
|
230
230
|
|
|
@@ -655,6 +655,9 @@ class DotEnvConfig(metaclass=ConfigMeta):
|
|
|
655
655
|
logger.info(f"{self.__class__.__name__} configuration reloaded successfully")
|
|
656
656
|
logger.debug(f"Reloaded fields: {', '.join(self._fields.keys())}")
|
|
657
657
|
|
|
658
|
+
self._load_env = reload_env
|
|
659
|
+
self._load_override = reload_override
|
|
660
|
+
self._load_env_dir = reload_env_dir
|
|
658
661
|
return self
|
|
659
662
|
|
|
660
663
|
@classmethod
|
|
@@ -236,6 +236,28 @@ class TestCached:
|
|
|
236
236
|
reported = list(caplog.records)
|
|
237
237
|
assert reported == []
|
|
238
238
|
|
|
239
|
+
def test_reload_with_new_env_updates_loaded_with(self, monkeypatch) -> None:
|
|
240
|
+
"""``reload(env=...)`` must update ``loaded_with()`` so a subsequent bare reload reuses it.
|
|
241
|
+
|
|
242
|
+
Without this, ``reload(env="prod")`` leaves ``loaded_with()`` reporting the original
|
|
243
|
+
env, a bare ``reload()`` silently reverts to it, and ``cached()`` warns on the
|
|
244
|
+
env the instance actually holds because ``loaded_with()`` still says the old one.
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
class Config(DotEnvConfig):
|
|
248
|
+
value: str = Field(default="x")
|
|
249
|
+
|
|
250
|
+
instance = Config.load(env="dev", override=False)
|
|
251
|
+
assert instance.loaded_with() == ("dev", False, None)
|
|
252
|
+
|
|
253
|
+
instance.reload(env="prod")
|
|
254
|
+
|
|
255
|
+
assert instance.loaded_with() == ("prod", False, None)
|
|
256
|
+
|
|
257
|
+
instance.reload()
|
|
258
|
+
|
|
259
|
+
assert instance.loaded_with() == ("prod", False, None)
|
|
260
|
+
|
|
239
261
|
def test_a_reset_cache_is_not_judged_against_the_arguments_it_dropped(
|
|
240
262
|
self, monkeypatch, caplog
|
|
241
263
|
) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|