-
Notifications
You must be signed in to change notification settings - Fork 399
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 basic typing support #1059
Merged
Merged
Add basic typing support #1059
Conversation
This file contains 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
rbarrois
force-pushed
the
improved-basic-typing
branch
2 times, most recently
from
January 18, 2024 14:19
250e538
to
ac7fa0e
Compare
Only `Factory.build()` and `Factory.create()` are properly typed, provided the class is declared as `class UserFactory(Factory[User]):`. Relies on mypy for tests. Reviewed-By: Raphaël Barrois <[email protected]>
rbarrois
force-pushed
the
improved-basic-typing
branch
from
January 18, 2024 14:25
ac7fa0e
to
68de8e7
Compare
goodspark
added a commit
to goodspark/factory_boy
that referenced
this pull request
Aug 20, 2024
This extends FactoryBoy#1059 to support SQLAlchemy as well.
browniebroke
added a commit
to browniebroke/cookiecutter-django
that referenced
this pull request
Aug 21, 2024
Since factory-boy 3.3.1, we can type annotate factories: FactoryBoy/factory_boy#1059 Setting that up for the only factory of the project
2 tasks
browniebroke
added a commit
to cookiecutter/cookiecutter-django
that referenced
this pull request
Aug 21, 2024
Since factory-boy 3.3.1, we can type annotate factories: FactoryBoy/factory_boy#1059 Setting that up for the only factory of the project
DavidCain
added a commit
to DavidCain/factory_boy
that referenced
this pull request
Nov 7, 2024
Basic typing support was added recently, exposing return types for `create()` and `build()`: FactoryBoy#1059 However, because this package does not expose these types, consumers of `factory-boy` cannot leverage the annotations! Let's ensure that the package exports its types. It's okay for only a subset of methods to be typed! (In other words, it's still compliant with PEP 561 to have partial coverage).
DavidCain
added a commit
to DavidCain/factory_boy
that referenced
this pull request
Nov 7, 2024
Basic typing support was added recently, exposing return types for `create()` and `build()`: FactoryBoy#1059 However, because this package does not expose these types, consumers of `factory-boy` cannot leverage the annotations! Let's ensure that the package exports its types. It's okay for only a subset of methods to be typed! (In other words, it's still compliant with PEP 561 to have partial coverage).
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.
Only
Factory.build()
andFactory.create()
are properly typed, provided the class is declared asclass UserFactory(Factory[User]):
.Relies on mypy for tests.
Reviewed-By: Raphaël Barrois [email protected]