intake / intake-esm

An intake plugin for parsing an Earth System Model (ESM) catalog and loading assets into xarray datasets.
https://intake-esm.readthedocs.io
Apache License 2.0
135 stars 46 forks source link

Updates for pydantic v2 #619

Closed dougiesquire closed 1 year ago

dougiesquire commented 1 year ago

Change Summary

This PR implements changes required for Intake-ESM to update to the recently-released pydantic v2. I'd appreciate someone taking a close look at this as I'm not a pydantic expert, especially v2.

Related issue number

Closes #617

Checklist

dougiesquire commented 1 year ago

Agh, the autodoc_pydantic Sphinx extension does not support pydantic v2 and it doesn't look like it will any time soon, see https://github.com/mansenfranzen/autodoc_pydantic/issues/146.

What to do?

dougiesquire commented 1 year ago

I tried to disable the autodoc_pydantic extension and temporarily change the CI doc environment to install ecgtools from https://github.com/ncar-xdev/ecgtools/pull/164 so the docs would build in this PR, but there's another issue with the docs that makes the build fail intermittently.

Instead, here's is a screenshot of the API docs for a pydantic object rendered without the autodoc_pydantic extension. I think they look fine. Let me know if you agree and I'll finish up this PR.

Screenshot 2023-07-06 at 10 51 26 pm
mgrover1 commented 1 year ago

I tried to disable the autodoc_pydantic extension and temporarily change the CI doc environment to install ecgtools from ncar-xdev/ecgtools#164 so the docs would build in this PR, but there's another issue with the docs that makes the build fail intermittently.

Instead, here's is a screenshot of the API docs for a pydantic object rendered without the autodoc_pydantic extension. I think they look fine. Let me know if you agree and I'll finish up this PR.

Screenshot 2023-07-06 at 10 51 26 pm

Thanks so much @dougiesquire for the hard work here - I think this looks fine and we can proceed!

dougiesquire commented 1 year ago

Ready for review @mgrover1

Note, the docs build is still failing because of:

  1. the pydantic changes required in ecgtools
  2. another intermittent issue when running docs/source/how-to/build-a-catalog-from-timeseries-files.md.

I suggest:

mansenfranzen commented 1 year ago

@dougiesquire You can now test the new autodoc_pydantic version supporting pydantic v2 via pip install autodoc_pydantic==2.0.0. The dev docs already showcase v2 support (see here). Migration guide is available here.

Any feedback is more than appreciated. The current autodoc_pydantic version 2.0.0 on pypi remains yanked for one week until final release.