Tracking ty compatibility#4168
Draft
behrmann wants to merge 1 commit into
Draft
Conversation
daandemeyer
reviewed
Feb 14, 2026
| @@ -5187,12 +5194,12 @@ def run_verb(args: Args, tools: Config | None, images: Sequence[Config], *, reso | |||
| if any((c := config).is_incremental() and not have_cache(config) for config in images): | |||
Contributor
There was a problem hiding this comment.
You can write this as a regular for loop with a check at the beginning to continue to not have to add the comments I think
Contributor
Author
There was a problem hiding this comment.
That's tracked in this issue and already has a PR
| @@ -4639,7 +4641,7 @@ def resolve_deps(images: Sequence[Config], include: Sequence[str]) -> list[Confi | |||
| graph = {config.image: config.dependencies for config in images} | |||
|
|
|||
| if any((missing := i) not in graph for i in include): | |||
Merged
ty is a new checker from the people that brought us ruff and uv. Since it is written in Rust, it is vastly faster than mypy or pyright. It is not yet fully features, but the recent release has removed about 80% of the false positives it had before. This allows us to annotate the remaining false positives with ignore comments for ty specifically. At the same time, ty complains about type ignore comments, that are needed for either mypy or pyright. Unfortunately there is no syntax for type checker specific ignores, but we can silence those errors for ty. This also adds comments on which type checker makes a specific type ignore comment necessary. Unfortunately the tests cannot yet be properly type checked with ty due to [1]. [1] astral-sh/ty#2797
5787ecc to
f96690d
Compare
Contributor
Author
|
Drafting this now to keep this around as a tracking PR what would be needed to make mkosi check successfully with ty. This should be merged as is, since ty should learn the things that are currently missing and adding the ignores here could silence them in their CI, which also checks mkosi. |
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.
ty is a new checker from the people that brought us ruff and uv. Since it is written in Rust, it is vastly faster than mypy or pyright. It is not yet fully features, but the recent release has removed about 80% of the false positives it had before. This allows us to annotate the remaining false positives with ignore comments for ty specifically and add two type annotations that also make the intent clearer to the human reader.
At the same time, ty complains about type ignore comments, that are needed for either mypy or pyright. Unfortunately there is no syntax for type checker specific ignores, but we can silence those errors for ty. This also adds comments on which type checker makes a specific type ignore comment necessary.
Unfortunately the tests cannot yet be properly type checked with ty due to [1].
[1] astral-sh/ty#2797