fix(config): ipinfo_* deprecation no longer warns on a None value (v3.2.1)#32
Closed
rennf93 wants to merge 2 commits into
Closed
fix(config): ipinfo_* deprecation no longer warns on a None value (v3.2.1)#32rennf93 wants to merge 2 commits into
rennf93 wants to merge 2 commits into
Conversation
….2.1) The ipinfo_token / ipinfo_db_path DeprecationWarning added in 3.2.0 keyed only on whether the field was passed to the constructor, so a caller that forwards an optional setting — SecurityConfig(ipinfo_token=settings.token) where the setting may be None — got a spurious warning even when ipinfo was not in use. The warning now fires only when the value is non-None. Bumps 3.2.0 -> 3.2.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
PARKED — do not merge. Hold this until someone actually complains about the spurious warning. Ready to go when needed.
Summary
The
ipinfo_token/ipinfo_db_pathDeprecationWarningintroduced in 3.2.0 keyed only onmodel_fields_set(was the field passed to the constructor), so a caller forwarding an optional setting —SecurityConfig(ipinfo_token=settings.ipinfo_token)where the setting may beNone— got a spurious deprecation warning even when ipinfo was not in use.Surfaced by guard-core-app's SaaS backend (
security.py:43passesipinfo_token=app_config.ipinfo_tokenunconditionally) — it warns at startup even when ipinfo is unconfigured.Fix
warn_deprecated_fieldsnow skips fields whose value isNone, so the warning fires only when the deprecated field is actually in use:Bumps 3.2.0 → 3.2.1 (pyproject,
.mike.yml,versions.json; CHANGELOG + release-notes entry).Verification
SecurityConfig(ipinfo_token=None, ipinfo_db_path=None)emits no deprecation (covers the newcontinuebranch); existing real-value tests still assert it warns.