chore(server): Replace mypy with ty#504
Merged
pedro-avalos merged 5 commits intomainfrom Jan 30, 2026
Merged
Conversation
also updated code to comply with ty rules
this provides typing functionality to sqlalchemy-utils (which we use in tests)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #504 +/- ##
=======================================
Coverage 89.27% 89.27%
=======================================
Files 28 28
Lines 1417 1417
Branches 4 4
=======================================
Hits 1265 1265
Misses 151 151
Partials 1 1
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
rene-oromtz
approved these changes
Jan 29, 2026
rene-oromtz
left a comment
There was a problem hiding this comment.
Looks really nice! Super simple to migrate from mypy to ty and really fast!
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.
Description
mypywithtyfor type-checkingtyoutperformsmypyin speed; it also is part of the Astral toolset (of which we are using more in our org).(In the GitHub CI, it seems to be a difference between about 7 seconds to under 0.25 seconds)
Related Issue(s)
Untracked
Testing
Unit tests
Manual testing steps:
uv syncuvx tox run -e lintChecklist
Additional Notes
I added a
# ty: ignore[invalid-argument-type]comment onmain.pybecause of an existing bug intythat is not supportingParamSpecat the moment. A follow-up PR should remove this once a fix is in place inty.This PR only replaces
mypyin the Server project, not the Charm, for a couple reasons:mypyin the Charm teststy(ormypy) on the Charm, I ran into a lot of errors because of the wayopspackagesops.testing(ops[testing]is basically installingops-scenarioand hacking it into anops.testingmodule)