Skip to content

👷 Replace mypy with ty in precommit#1806

Open
svlandeg wants to merge 17 commits intofastapi:mainfrom
svlandeg:feat/ty
Open

👷 Replace mypy with ty in precommit#1806
svlandeg wants to merge 17 commits intofastapi:mainfrom
svlandeg:feat/ty

Conversation

@svlandeg
Copy link
Member

@svlandeg svlandeg commented Mar 9, 2026

  • Replace mypy with ty in precommit, lint.sh & pyproject.toml.
  • Type fixes to make ty happy

I originally set out to have mypy and ty run together in precommit, but for sqlmodel I would argue that perhaps we want to remove mypy alltogether already now, as it allows us to remove a lot of type: ignore statements that ty thinks are unnecessary anyway.

⚠️ This requires thorough review, I'm not super sure on all decisions taken here, cf 2 separate review comments below 👇

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

📝 Docs preview

Last commit 9103510 at: https://c409eb10.sqlmodel.pages.dev

@svlandeg svlandeg self-assigned this Mar 9, 2026
@svlandeg svlandeg changed the title 👷 Add ty to precommit 👷 Replace mypy with ty in precommit Mar 10, 2026
@svlandeg svlandeg marked this pull request as ready for review March 10, 2026 10:16
@svlandeg svlandeg removed their assignment Mar 10, 2026
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Mar 14, 2026
@github-actions

This comment was marked as resolved.

# Conflicts:
#	pyproject.toml
#	uv.lock
@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Mar 14, 2026
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Mar 15, 2026
@svlandeg svlandeg self-assigned this Mar 15, 2026
# Conflicts:
#	pyproject.toml
#	uv.lock
@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Mar 16, 2026
@svlandeg svlandeg removed their assignment Mar 16, 2026
@svlandeg svlandeg requested a review from YuriiMotov March 16, 2026 09:15
Copy link
Member

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

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

Added a few suggestions in the comments. Please, take a look)

its `WHERE` clause, joined to the existing clause via `AND`, if any.
"""
return super().where(*whereclause) # type: ignore[arg-type]
return super().where(*whereclause)
Copy link
Member

Choose a reason for hiding this comment

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

It's ty's mistake that it doesn't notice type mismatch here. But I checked - passing bool argument works in runtime

@svlandeg svlandeg marked this pull request as draft March 18, 2026 16:29
@svlandeg
Copy link
Member Author

@YuriiMotov, thanks for the review! I addressed everything, looks better IMO 🙂

@svlandeg svlandeg marked this pull request as ready for review March 18, 2026 17:07
@svlandeg svlandeg removed their assignment Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants