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 hypothesis plugin #34

Closed
hirotasoshu opened this issue May 4, 2023 · 6 comments
Closed

Add hypothesis plugin #34

hirotasoshu opened this issue May 4, 2023 · 6 comments

Comments

@hirotasoshu
Copy link
Contributor

hirotasoshu commented May 4, 2023

Since this is separate package, hypothesis plugin for pydantic will not work for this types.
Instead of making a separate plugin, support for pydantic-extra-types can be added to the pydantic hypothesis plugin as part of pydantic/pydantic#4682.

@yezz123
Copy link
Collaborator

yezz123 commented May 4, 2023

Hey @hirotasoshu

I appreciate your input, but I disagree because there are various types available such as PostgreSQL, MySQL, Emailstr, and other commonly used types including the Hypothesis plugin.

IMO, it would be more beneficial for these types to remain within Pydantic for now.

I guess @samuelcolvin @dmontagu will agree with me about that

@samuelcolvin
Copy link
Member

I think with V2 we probably won't need the hypothesis plugin for most things, well need some compatibility on a few types.

@yezz123
Copy link
Collaborator

yezz123 commented May 4, 2023

well need some compatibility on a few types.

+1 working on them to make bunch of stuff ready

@yezz123 yezz123 closed this as completed May 4, 2023
@hirotasoshu
Copy link
Contributor Author

@yezz123 I'm sorry, I think I put it wrong. I didn't mean to transfer the entire pydantic hypothesis plugin into this package. I just wanted hypothesis to work with pydantic-extra-types because the current implementation of the hypothesis plugin only registers pydantic types. I was thinking of two options:

  1. Create a separate pydantic-extra-types hypothesis plugin only for types in this package.
  2. Add pydantic-extra-types support to the existing hypothesis plugin.

@samuelcolvin will this work for types that have complex validation? For example, for card numbers (luhn algorithm).If so, then this issue doesn't make sense)

@samuelcolvin
Copy link
Member

See annotated-types/annotated-types#37.

Ideally we don't need any hypothesis plugins.

@hirotasoshu
Copy link
Contributor Author

hirotasoshu commented May 5, 2023

See annotated-types/annotated-types#37.

Ideally we don't need any hypothesis plugins.

Oh, I see, thanks for the clarification)

hirotasoshu added a commit to hirotasoshu/pydantic-extra-types that referenced this issue May 14, 2023
yezz123 pushed a commit that referenced this issue May 21, 2023
* chore: remove note about hypothesis plugin

See #34 for
details

* feat: add mir card brand

* test: add tests for mir card brand
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

No branches or pull requests

3 participants