Flagsmith / flagsmith-engine

This project powers the core Flagsmith API flag evaluations engine.
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
10 stars 6 forks source link

feat: pydantic V2 #189

Closed matthewelwell closed 1 year ago

matthewelwell commented 1 year ago

Update to pydantic V2. What I've done so far:

  1. Updated the pydantic and pydantic-collections dependencies using pip-tools
  2. pip install bump-pydantic && bump-pydantic flag_engine
  3. Replaced the root_validator method _generate_default_composite_key on the IdentityModel with a computed_field named composite_key.
  4. Added typeguard dependency and changed if isinstance(value, TRAIT_VALUE_TYPES) to check_type(value, TRAIT_VALUE_TYPES)
github-actions[bot] commented 1 year ago

File Coverage
All files 100% :white_check_mark:

Minimum allowed coverage is 100%

Generated by :monkey: cobertura-action against d02885eeea8655861b33337c848eb83c841ffb8b

khvn26 commented 1 year ago

Finalised the work:

Switched typeguard usage to type_annotations.TypeGuard type instead.

khvn26 commented 1 year ago

Closing in favour of https://github.com/Flagsmith/flagsmith-engine/pull/190 to allow @matthewelwell to review.