Skip to content

👷 Add ty to precommit#2227

Open
svlandeg wants to merge 16 commits intofastapi:masterfrom
svlandeg:feat/ty
Open

👷 Add ty to precommit#2227
svlandeg wants to merge 16 commits intofastapi:masterfrom
svlandeg:feat/ty

Conversation

@svlandeg
Copy link
Copy Markdown
Member

@svlandeg svlandeg commented Mar 10, 2026

  • Add ty to pyproject, lint.sh & precommit
  • Ensure that warnings are reported as errors
  • Added some type fixes to make ty happy
  • Includes a bug fix (I think) ? cf separate review comment 👇

@svlandeg svlandeg marked this pull request as draft March 10, 2026 11:09
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'item', type_='foreignkey')
op.drop_constraint('item_owner_id_fkey', 'item', type_='foreignkey')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A little confused about this one, as drop_constraint requires a str constraint name. Not sure why it was None before and I don't see how it would have worked. Feels like this is an actual bug fix? 🤔

@svlandeg svlandeg requested a review from alejsdev March 10, 2026 15:01
@svlandeg svlandeg marked this pull request as ready for review March 10, 2026 15:01
@svlandeg svlandeg marked this pull request as draft March 26, 2026 22:21
@svlandeg svlandeg self-assigned this Mar 26, 2026
@svlandeg svlandeg removed their assignment Mar 26, 2026
@svlandeg svlandeg marked this pull request as ready for review March 26, 2026 23:14
@svlandeg svlandeg marked this pull request as draft March 27, 2026 09:57
@svlandeg svlandeg self-assigned this Mar 27, 2026
@svlandeg svlandeg marked this pull request as ready for review March 27, 2026 10:05
@svlandeg svlandeg removed their assignment Mar 27, 2026
Copy link
Copy Markdown
Member Author

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

@alejsdev : by bumping to ty 0.0.25, we're able to have less ignore statements when combining mypy with ty, cf this edit. So I think that's nice! I also changed the settings to error on warning, as discussed with Sebastián - we'll do this for all our repos. So this should be in a good state to review/merge (again) now 🙏

@svlandeg svlandeg requested a review from alejsdev March 27, 2026 10:07
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.

3 participants