Skip to content

🐛 fix(type): resolve ty 0.0.17 compatibility#3807

Merged
gaborbernat merged 1 commit intomainfrom
fix/ty-compat
Feb 21, 2026
Merged

🐛 fix(type): resolve ty 0.0.17 compatibility#3807
gaborbernat merged 1 commit intomainfrom
fix/ty-compat

Conversation

@gaborbernat
Copy link
Member

ty 0.0.17 introduced new diagnostics that cause CI failures. The redundant-final-classvar warning flags Final[ClassVar[...]] in docs/tox_conf.py since Final already implies class-level scope, making ClassVar redundant. The call-top-callable errors in src/tox/config/of_type.py arise because callable() cannot statically narrow Callable[[], T] | T when T is an unconstrained type variable — the value could itself be callable, so ty can't determine the call signature.

Removed the redundant Final wrapper and added ty: ignore[call-top-callable] suppressions for the two callable() guards, which are a valid runtime pattern that ty cannot verify statically.

ty 0.0.17 introduced `redundant-final-classvar` and `call-top-callable`
diagnostics. The `Final[ClassVar[...]]` combination was redundant, and
`callable()` on `Callable[[], T] | T` can't be statically narrowed when
`T` is unconstrained.
@gaborbernat gaborbernat merged commit 9cd5b69 into main Feb 21, 2026
30 of 31 checks passed
@gaborbernat gaborbernat deleted the fix/ty-compat branch February 21, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant