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

feat: move to Pydantic 2.0 and use the 1.10 patch branch #163

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

AbeCoull
Copy link
Contributor

@AbeCoull AbeCoull commented Oct 12, 2023

Issue #, if available:

Description of changes:
Ran:

find src/* -type f -exec sed -i 's/from pydantic/from pydantic.v1/g' {} \;

find test/* -type f -exec sed -i 's/from pydantic/from pydantic.v1/g' {} \;

Testing done:
Passed tox execution and tested the branch with the SDK and Default-sim repos with similar patches. Both successfully passed tox executions.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AbeCoull AbeCoull requested a review from krneta October 12, 2023 22:59
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (66d5f0e) to head (073c04d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #163   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           93        93           
  Lines         1398      1398           
  Branches        25        25           
=========================================
  Hits          1398      1398           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AbeCoull
Copy link
Contributor Author

Dependent tests are expected to fail as they have version conflicts due to their dependency constraints. See testing notes for more details.

@isobelhooper
Copy link

Out of interest, is there a timeline for this PR being worked on? I'm working on a project that uses Braket (including this library and https://github.com/amazon-braket/amazon-braket-default-simulator-python) and because of these dependencies we're still limited to Pydantic v1. Would be good to be able to upgrade!

@AbeCoull
Copy link
Contributor Author

Hi @isobelhooper and apologies for the delay.

The team is currently exploring options to make these upgrades, we will post more information in this thread when we have an update.

@AbeCoull
Copy link
Contributor Author

Relaxing constraints in the default simulator: amazon-braket/amazon-braket-default-simulator-python#224

@richrines1
Copy link

maybe not super elegant, but fwiw to avoid conflicts with downstream dependencies you could also use something like

try:
    from pydantic.v1 import ...
except ImportError:
    from pydantic import ...

everywhere (at least temporarily) and just pin pydantic >= 1.8.2 so this would work with both pydantic 1.* and 2.*

@AbeCoull
Copy link
Contributor Author

Hi @richrines1, thank you for the suggestion. The team is going to use a slightly different release method with pinned versions to unblock this.

@AbeCoull AbeCoull marked this pull request as ready for review March 27, 2024 21:08
@AbeCoull AbeCoull requested a review from a team as a code owner March 27, 2024 21:08
@AbeCoull AbeCoull merged commit 43d89ed into main Mar 27, 2024
24 checks passed
@AbeCoull AbeCoull deleted the pydantic_2_v1 branch March 27, 2024 22:30
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.

4 participants