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

Allow Pydantic v2 in test environments #1684

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Allow Pydantic v2 in test environments #1684

wants to merge 21 commits into from

Conversation

mattwthompson
Copy link
Member

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #1684 (8b16da3) into main (d8e1d7a) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

@mattwthompson
Copy link
Member Author

Will wait to finish this until openff-nagl 0.3.0 is released

@mattwthompson mattwthompson marked this pull request as ready for review August 31, 2023 15:57
@mattwthompson
Copy link
Member Author

mattwthompson commented Aug 31, 2023

Seems to be working, modulo QCArchive allowing records to be pulled down

Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

This PR seems to do 6 things:

  1. Adds pydantic=1 and 2 variants to the CI matrix
  2. (maybe) Changes some things to make pydantic 2 work
  3. Changes some things to make mypy happy
  4. Has pre-commit start removing blank lines at ends of files
  5. Makes some helpful-looking changes to Molecule.visualize tests
  6. Gets has_pkg and requires_pkg from openff-utils instead of keeping a redundant definition

For 1 - The changes here seem to have made the test configurations more complex/brittle. What form would the final CI changes take if this is merged?

For 2 - Are there any source code changes in here to get pydantic 2 compatibility or did we have that all along?

The changes for items 3, 4, 5, and 6 are good by me.

@mattwthompson
Copy link
Member Author

The toolkit does not use Pydantic at all; the objective here is to ensure tests pass with both v1 and v2. No code changes (here) are needed to allow users to install v2.

The main complexity added here is working around QCArchive not supporting v2. I don't take dropping QCArchive interoperability or limiting Pydantic compatibility to be workable options, and as long as v1 is still supported at installation time it's something that should be tested. So the final matrix will look a little more complex, with maybe a couple of combinations stripped out.

@j-wags
Copy link
Member

j-wags commented Sep 7, 2023

Gotcha. Ok, it's great to know that OFFTK is ready for pydantic v2. I'd like to leave this open until the pydantic v2-compatible QCF packages are out. If we merge it sooner, we have no choice but to expand the cost/complexity of our CI matrix, and then make a second round of changes once the new QCF packages come out.

If we want to allow pydantic=2 in our conda packages before then, I'd approve a PR/patch to do so!

@mattwthompson
Copy link
Member Author

Seems like we already do https://prefix.dev/channels/conda-forge/packages/openff-toolkit-base

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.

2 participants