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

Updates for pydantic v2 #619

Merged
merged 9 commits into from
Jul 7, 2023
Merged

Conversation

dougiesquire
Copy link
Contributor

@dougiesquire dougiesquire commented Jul 6, 2023

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

  • Unit tests for the changes exist
  • Tests pass on CI

@dougiesquire dougiesquire requested a review from mgrover1 as a code owner July 6, 2023 10:24
@dougiesquire
Copy link
Contributor Author

dougiesquire commented Jul 6, 2023

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

What to do?

  • Update Intake-ESM to use pydantic v2 and lose the autodoc_pydantic extension, resulting in the API section of the docs being poorly formatted. (Unfortunately, I can't generate a version of the docs atm to demonstrate what this would look like as the docs rely on ecgtools which also requires pydantic updates, see Updates for pydantic v2 ncar-xdev/ecgtools#164. Yes, we're in a state right now where Intake-ESM and ecgtools are both failing because the other is failing),
  • Pin pydantic to v1 in Intake-ESM (and ecgtools).

@dougiesquire
Copy link
Contributor Author

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

@mgrover1
Copy link
Collaborator

mgrover1 commented Jul 6, 2023

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
Copy link
Contributor Author

dougiesquire commented Jul 7, 2023

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:

@mgrover1 mgrover1 merged commit 92e771a into intake:main Jul 7, 2023
@dougiesquire dougiesquire deleted the 617_pydantic_update branch July 7, 2023 03:06
@dougiesquire dougiesquire mentioned this pull request Jul 7, 2023
@mansenfranzen
Copy link

@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.

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.

Updates needed for pydantic v2
3 participants