Skip to content

support pydantic 3.13#808

Draft
atravitz wants to merge 4 commits into
mainfrom
maint/pydantic_3.13
Draft

support pydantic 3.13#808
atravitz wants to merge 4 commits into
mainfrom
maint/pydantic_3.13

Conversation

@atravitz

@atravitz atravitz commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

resolves #807

Note that this will push us to drop python 3.11, which is out of SPEC0.

Tips

  • Comment "pre-commit.ci autofix" to have pre-commit.ci atomically format your PR.
    Since this will create a commit, it is best to make this comment when you are finished with your work.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no

Checklist

  • Added a news entry
  • Filled in the AI-generated code disclosure.

Developers certificate of origin

@atravitz atravitz changed the title update env for upstream openff pydantic fixes support pydantic 3.13 Jun 30, 2026
@atravitz

atravitz commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

currently, these are ways we could fix things, but the existing model_dump() behavior is a problem IMO.

for example, in the test src/gufe/tests/test_models.py(340)test_frozen_equality_changed()

s1.model_dump()
  > {'forcefield_settings': {}, 'thermo_settings': {'temperature': {'val': 300, 'unit': 'kelvin'}, 'pressure': None, 'ph': None, 'redox_potential': None}}`

(note 'forcefield_settings':{})
vs

s1.forcefield_settings.model_dump()
 > {'constraints': 'allbonds', 'rigid_water': True, 'hydrogen_mass': 3.0, 'forcefields': ['amber/ff14SB.xml', 'amber/tip3p_standard.xml', 'amber/tip3p_HFE_multivalent.xml', 'amber/phosaa10.xml', 'amber/lipid17_merged.xml'], 'small_molecule_forcefield': 'openff-2.2.1', 'nonbonded_method': 'PME', 'nonbonded_cutoff': {'val': 0.9, 'unit': 'nanometer'}}

I think we should be able to resolve this in model settings or something similarly upstream, but I haven't sorted it out yet.

@atravitz atravitz marked this pull request as draft June 30, 2026 18:47
@github-actions

Copy link
Copy Markdown

No API break detected ✅

View workflow run

Griffe output
$ griffe check "gufe" -s src --no-inspection --no-color --verbose -a origin/main

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (b18420e) to head (f56747f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #808   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files          43       43           
  Lines        2807     2807           
=======================================
  Hits         2769     2769           
  Misses         38       38           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atravitz atravitz mentioned this pull request Jun 30, 2026
2 tasks
@atravitz

Copy link
Copy Markdown
Contributor Author

pull in this comment from @mattwthompson :

I'm not sure why the serialized representation changes - whether or not the default value of "nonbonded_cutoff" is serialized might not be important, but I've seen problems1 in which a serialized non-default value is ignored and set to the default value2.

The failures due to dependencies not being installed is just from the switch to the Conda package to the development install - cachetools, python-constraint, and xmltodict are probably all you need

Footnotes

  1. https://github.com/openforcefield/openff-interchange/pull/1501#issuecomment-4545442911

  2. Bad!

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.

support pydantic >=2.13

1 participant