refactor(exports): single-source __all__ from guard_core (O3)#93
Open
rennf93 wants to merge 1 commit into
Open
refactor(exports): single-source __all__ from guard_core (O3)#93rennf93 wants to merge 1 commit into
rennf93 wants to merge 1 commit into
Conversation
…ter (O3) Derive guard.__all__ from guard_core.__all__ plus the two fastapi-guard locals (SecurityMiddleware, __version__) instead of hand-duplicating the 22 re-exported names, so the lists can't silently drift. Re-exports use the explicit `X as X` form (typed re-export, no F401); combine-as-imports keeps the block tidy. A test asserts __all__ equals guard_core's surface plus the locals; the existing test already asserts every name is importable. Also filter guard-core 3.2.0's new ipinfo_* DeprecationWarning in the test suite (fixtures set ipinfo_db_path); the guard-core side documents the deprecation path.
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.
Summary
Design-partner feedback O3 (fastapi-guard half). The guard-core side ships the API-surface audit +
ipinfo_*deprecation (guard-core PR for O3). This is the consumer-side wiring.Note
Stacked on #92 (the guard-core 3.2.0 adoption). Review/merge #92 first; GitHub will retarget this to
master. The diff here is only the export + filter change.Export single source of truth
guard.__all__previously hand-duplicated the 22 names re-exported fromguard_core, so the two lists could silently drift. Now__all__is derived fromguard_core.__all__plus fastapi-guard's two locals (SecurityMiddleware,__version__):X as Xtyped-re-export form (no# noqa, no F401);combine-as-importskeeps the block tidy.__all__equals guard_core's surface plus the locals; the existingtest_all_exports_importablealready asserts every name is importable — together they make a missing downstream re-export a loud test failure, not silent drift.Deprecation filter
guard-core 3.2.0 adds a runtime
DeprecationWarningwhen the deprecatedipinfo_token/ipinfo_db_pathare set. fastapi-guard's fixtures setipinfo_db_path, so the suite filters that specific warning (the deprecation itself is documented and tested on the guard-core side).Verification
Part of the coordinated guard-core 3.2.0 release.