Skip to content

Conversation

@svlandeg
Copy link
Member

@svlandeg svlandeg commented Jan 6, 2026

For now, running ty in parallel to mypy to see what kind of errors/warnings come up.

@svlandeg svlandeg changed the title 👷 Add ty in the CI lint check 👷 Add ty to the CI lint check Jan 6, 2026
@svlandeg svlandeg self-assigned this Jan 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📝 Docs preview

Last commit 5a7bf84 at: https://3cf779e6.typertiangolo.pages.dev

@svlandeg svlandeg added repo / tests Involving the CI / test suite internal labels Jan 6, 2026
return inspect.cleandoc(typer_info.help or "")
# Priority 2: Explicit value was set in sub_app.callback()
try:
if typer_info.typer_instance and typer_info.typer_instance.registered_callback:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This edit and the lines below is not strictly necessary: they are "possibly-missing-attribute" warnings from ty that won't fail the CI. Still, IMO it's nice to test for this explicitely up-front instead of having the try-catch. This is a bit of personal preference though, so will leave it to Tiangolo to make the final decision.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making these edits, we have two other options:

  • add ty: ignore statements
  • just leave the warnings as is (though this is somewhat annoying when running the tool locally and getting all the warnings output)

@svlandeg
Copy link
Member Author

svlandeg commented Jan 7, 2026

Ok this is ready for review @tiangolo.

TLDR decisions to take:

  • Do we resolve issues with assert and cast statements (first few commits in this PR) or by using ignore statements (final commits & current state)? I think mostly in our repo's we've been resorting to ignore statements so far.
  • If we want ignore statements, are we happy with ty: ignore? I'd prefer it because 1) ty doesn't support type: ignore with specific violations between brackets, and 2) if we use type: ignore, mypy will complain, and we'd have to put type: ignore[unused-ignore] which will work because of 1) but feels ugly/hacky.
  • Do we want to resolve also ty warnings even if they don't fail the CI? (if yes, we can also enforce this via the CI with --error-on-warning

@svlandeg svlandeg marked this pull request as ready for review January 7, 2026 10:55
@svlandeg svlandeg removed their assignment Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal repo / tests Involving the CI / test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant