refactor: centralize optional-dependency typing shims#717
Merged
cofin merged 0 commit intolitestar-org:feat/serializer-stufffrom Apr 26, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #717 +/- ##
========================================
Coverage 81.21% 81.22%
========================================
Files 99 100 +1
Lines 8300 8576 +276
Branches 1124 1160 +36
========================================
+ Hits 6741 6966 +225
- Misses 1232 1271 +39
- Partials 327 339 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f34718e to
009edb1
Compare
a53740c to
e888e39
Compare
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
Centralizes every optional-dependency feature flag and stub type into a single canonical module, and enforces that internal code only imports from the public surface.
Stacked on top of #716 — diff will collapse to a single commit once that merges.
Changes
advanced_alchemy/_typing.pythe single source of truth for all*_INSTALLEDflags and optional-dependency stub types (pydantic, msgspec, attrs, cattrs, litestar, sqlmodel, numpy, orjson).advanced_alchemy/typing.py.advanced_alchemy/service/_typing.py— its contents were generic shims with nothing service-specific.advanced_alchemy.typinginstead of reaching into private_typingmodules.Test plan
make lintpassesuv run pytest tests/unit -x -qpassesfrom advanced_alchemy.service import ATTRS_INSTALLEDstill works)