Skip to content

Upgrade ty type checker to latest version and fix mypy configuration#479

Merged
karlicoss merged 3 commits intomasterfrom
copilot/fix-e9c1cff2-872c-4c1f-a97a-bf13523e69a5
Sep 23, 2025
Merged

Upgrade ty type checker to latest version and fix mypy configuration#479
karlicoss merged 3 commits intomasterfrom
copilot/fix-e9c1cff2-872c-4c1f-a97a-bf13523e69a5

Conversation

Copy link
Contributor

Copilot AI commented Sep 23, 2025

This PR upgrades the ty type checker to the latest available version and fixes an invalid error code in the mypy configuration that was causing warnings.

Changes Made

Type Checker Upgrade

  • Updated ty dependency from >=0.0.1a20 to >=0.0.1a21 (latest version) in pyproject.toml

Mypy Configuration Fix

  • Removed invalid deprecated error code from mypy.ini that was causing warnings during type checking

Analysis of Existing ty: ignore Comments

During this upgrade, I thoroughly analyzed all existing ty: ignore comments to determine if they could be removed. After testing with both type checkers, all existing ignore comments are still necessary:

  • src/promnesia/cannon.py: The ty: ignore[invalid-return-type] comment addresses a known false positive in ty where it incorrectly thinks urlunsplit() returns bytes instead of str (see ty issue #733)
  • src/promnesia/logging.py: The ty: ignore[invalid-assignment] and ty: ignore[missing-argument] comments are legitimately needed for method assignment operations that both type checkers correctly flag as violations

Verification

Both mypy and ty now pass type checking without configuration warnings:

$ mypy --config-file mypy.ini src/promnesia/logging.py src/promnesia/cannon.py
Success: no issues found in 2 source files

$ ty check src/promnesia/logging.py src/promnesia/cannon.py  
All checks passed!

The changes are minimal and maintain backward compatibility while ensuring the project uses the latest type checking tools.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: karlicoss <291333+karlicoss@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade ty type checker to latest version, and remove unnecessary ty: ignore if any Upgrade ty type checker to latest version and fix mypy configuration Sep 23, 2025
Copilot AI requested a review from karlicoss September 23, 2025 20:18
@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.00%. Comparing base (3ea30a2) to head (be77c8a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #479   +/-   ##
=======================================
  Coverage   83.00%   83.00%           
=======================================
  Files          71       71           
  Lines        5253     5253           
  Branches      145      145           
=======================================
  Hits         4360     4360           
  Misses        748      748           
  Partials      145      145           
Flag Coverage Δ
mypy-3.10 82.98% <ø> (ø)
mypy-3.11 82.98% <ø> (ø)
mypy-3.12 83.00% <ø> (ø)
mypy-3.13 83.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@karlicoss karlicoss marked this pull request as ready for review September 23, 2025 20:47
@karlicoss karlicoss merged commit beac17e into master Sep 23, 2025
13 checks passed
@karlicoss karlicoss deleted the copilot/fix-e9c1cff2-872c-4c1f-a97a-bf13523e69a5 branch September 23, 2025 20:48
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.

2 participants