-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filedocumentationImprovements or additions to documentationImprovements or additions to documentation
Description
examples/ is currently excluded from ty checks; running ty on it reports many diagnostics.
Repro:
uv sync --all-extrasuv run ty check examples(currently: Found 138 diagnostics)
Top buckets observed:
- Missing optional deps used only in examples (
langsmith,streamlit,nltk,spacy,loguru,erdantic, etc.). - Examples importing modules that aren’t packaged/importable in that context (e.g. local
models, intra-example imports). - Intentional “wrong type” example calls that need
cast(...)or# type: ignore[...]to keep examples runnable while still type-checkable.
Goal
- Decide a policy for examples:
- Either make
uv run ty check examplespass with light annotations/guards, or - Keep excluded and add a separate optional CI job for “typed examples” subset.
- Either make
Possible approach
- Wrap optional imports in
try/except ImportError(orif TYPE_CHECKING:) so type checking doesn’t require installing every demo dependency. - For “demo-only” type violations, add targeted
# type: ignore[rule]with justification. - Consider splitting examples that require heavy deps into a separate folder excluded by default.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency filedocumentationImprovements or additions to documentationImprovements or additions to documentation