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

[IMP] Upgrade Pydantic from V1 to V2 #25

Merged
merged 8 commits into from
Sep 18, 2024

Conversation

orgis
Copy link

@orgis orgis commented Aug 2, 2024

Upgrade Pydantic from v1 to v2

Description

This pull request upgrades the Pydantic dependency from version ^1.10.8 to ^2.8.2 and refactors the codebase to replace deprecated features with the new style introduced in Pydantic v2.

Changes

Dependencies

  • Updated pydantic from ^1.10.8 to ^2.8.2 in pyproject.toml.

Code Refactoring

  • Refactored GopayModel class to use Pydantic v2 model_config attribute instead of Config class.
  • Ensured all (pydantic) model usages are up-to-date with Pydantic v2.

Testing

  • Ran the full test suite to ensure all tests pass with the updated dependency.
  • Three tests are failing (were failing before this change as well)
    • tests/test_api_payment.py::TestPayments::test_refund_payment
    • tests/test_api_recurrence.py::TestRecurrence::test_void_recurrence
    • tests/test_api_recurrence.py::TestRecurrence::test_create_next_ondemand_payment

Version

Changed package version from 2.0.2 to 3.0.0 as this can introduce breaking changes in codebases.

Copy link
Contributor

@geeshta geeshta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be a major version bump as it doesn't affect the public API in any way.
Keep the version as is and we will include the rest of the PR in the next minor version release along with other stuff

@geeshta geeshta merged commit 9185430 into gopaycommunity:master Sep 18, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

3 participants