Skip to content

Fix ty type-checking warnings#58

Merged
edumucelli merged 2 commits intomasterfrom
fix-ty-warnings
May 6, 2026
Merged

Fix ty type-checking warnings#58
edumucelli merged 2 commits intomasterfrom
fix-ty-warnings

Conversation

@edumucelli
Copy link
Copy Markdown
Owner

Summary

Fixes 38 ty type-checking warnings that were firing against the local source due to the system-installed docking package taking precedence in PYTHONPATH.

Changes

  • Pre-commit hook: Prepends $PWD to PYTHONPATH so ty resolves imports against the local development tree rather than the system-installed /usr/lib/docking/python.

  • updated_at parameter types: Changed from object | None to datetime | str | None in build_tooltip functions across hackernews, certwatch, thermals, and weather – matching the signatures of resolve_live_status and live_freshness_lines.

  • Mapping.get() overload resolution: Added cast(Mapping[str, Any], ...) wrappers after isinstance checks in JSON parsing functions (hackernews/state.py, deskpresence/state.py) so ty can resolve the correct .get() overload.

  • int()/float() argument types: Added isinstance guards before int() calls on values from untyped sequences and before float() calls on dict values.

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.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for dockingbar canceled.

Name Link
🔨 Latest commit 6663b5e
🔍 Latest deploy log https://app.netlify.com/projects/dockingbar/deploys/69fbc78b02ce9f0008d02d7e

@edumucelli edumucelli added the bug Something isn't working label May 6, 2026
@edumucelli edumucelli merged commit b212c52 into master May 6, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant