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

Remove dependency on pydantic #196

Closed
wants to merge 1 commit into from

Conversation

abravalheri
Copy link
Contributor

In this PR, I propose removing the dependency on pydantic to avoid the installation problems caused by the lack of pre-compiled wheels and/or the Rust toolchain in some platforms (e.g. Cygwin or FreeBSD).

The objective is to make improve the viability of inflect (and other packages that depend on it) as a OS agnostic library.

Main changes in implementation

  • Replace the pydantic.validate_call decorator with explicit calls to _validate_type, which is based on isinstance.

Main caveats

  • For number_to_words, I just introduced validation for the num argument, not for the other ones. Please let me know if it would be relevant to add validations for the other arguments too.
  • Calls previously raising pydantic...ValidationError will not raise TypeError(f"{obj!r} given, but expecting {types}").

@abravalheri
Copy link
Contributor Author

Close in favour of #199

@abravalheri abravalheri deleted the issue-195 branch August 31, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant