jaraco / inflect

Correctly generate plurals, ordinals, indefinite articles; convert numbers to words
https://pypi.org/project/inflect
MIT License
957 stars 107 forks source link

Support Pydantic 2 #191

Closed jaraco closed 1 year ago

jaraco commented 1 year ago
jaraco commented 1 year ago

One of the tests is failing due to https://github.com/pydantic/pydantic/issues/6390

jaraco commented 1 year ago

I've confirmed the failure in test_plequal is also due to pydantic/pydantic#6390 and this time it's in the code under test (not just the tests themselves).

jaraco commented 1 year ago

The failure in test_user_input_fns appears to happen because p.defnoun(None, "") injects an empty string into the list, but engine.ud_match indicates Optional[Word] so empty strings aren't allowed. This expectation wasn't enforced previously, but with pydantic 2, the missed expectation is caught.

(fixed in 49d572ce42eb631bf7d576a531283dcc8e7a2cec)

jaraco commented 1 year ago

I've been pushing backward-compatible incremental fixes to main, so this PR is no longer needed.