Fix ty type-checking warnings#58
Merged
edumucelli merged 2 commits intomasterfrom May 6, 2026
Merged
Conversation
Resolve 38 ty warnings across five applet state modules: - Fix updated_at parameter type from `object` to `datetime | str | None` in hackernews, certwatch, thermals, and weather build_tooltip functions to match the expected signatures of resolve_live_status and live_freshness_lines. - Add typed cast wrappers after isinstance checks in JSON parsing functions (hackernews/state.py, deskpresence/state.py) to fix Mapping.get() overload resolution. - Add isinstance guards before int() and float() calls on values from heterogeneous sequences to satisfy strict argument types. - Fix pre-commit hook to prioritize local source in PYTHONPATH so ty resolves against the development tree rather than the system-installed docking package.
✅ Deploy Preview for dockingbar canceled.
|
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
Fixes 38
tytype-checking warnings that were firing against the local source due to the system-installeddockingpackage taking precedence inPYTHONPATH.Changes
Pre-commit hook: Prepends
$PWDtoPYTHONPATHsotyresolves imports against the local development tree rather than the system-installed/usr/lib/docking/python.updated_atparameter types: Changed fromobject | Nonetodatetime | str | Noneinbuild_tooltipfunctions acrosshackernews,certwatch,thermals, andweather– matching the signatures ofresolve_live_statusandlive_freshness_lines.Mapping.get()overload resolution: Addedcast(Mapping[str, Any], ...)wrappers afterisinstancechecks in JSON parsing functions (hackernews/state.py,deskpresence/state.py) sotycan resolve the correct.get()overload.int()/float()argument types: Addedisinstanceguards beforeint()calls on values from untyped sequences and beforefloat()calls on dict values.