Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __all__ to __init__.py for type checkers #1493

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

zmievsa
Copy link
Contributor

@zmievsa zmievsa commented Oct 10, 2023

When you generate migrations using aerich, it imports BaseDBAsyncClient directly from tortoise but tortoise doesn't export it which is a problem for some type checkers such as pyright. This fix resolves this.

How Has This Been Tested?

No need for testing

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@zmievsa
Copy link
Contributor Author

zmievsa commented Oct 10, 2023

@long2ice A gentle ping to take a look. Note that this can break some integrations which imported "*" from tortoise and used some of the internal stuff defined/imported in the __init__.py but it is extremely unlikely.

@@ -9,6 +9,10 @@ Changelog
0.20
====

Added
Copy link
Member

Choose a reason for hiding this comment

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

Need in section 0.20.1

@long2ice
Copy link
Member

Thanks! Just need resolve conflicts.

@zmievsa
Copy link
Contributor Author

zmievsa commented Oct 11, 2023

@long2ice done! Big thanks for a quick reply.

@long2ice long2ice merged commit edde82e into tortoise:develop Oct 11, 2023
1 of 5 checks passed
@zmievsa zmievsa deleted the improve-migration-type-hinting branch October 11, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants