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

DM-42302: Drop support for Pydantic v1. #396

Merged
merged 5 commits into from Jan 4, 2024
Merged

DM-42302: Drop support for Pydantic v1. #396

merged 5 commits into from Jan 4, 2024

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Dec 21, 2023

Requires lsst/daf_butler#929

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Comparison is base (9d3cecc) 82.51% compared to head (473a15e) 82.25%.

Files Patch % Lines
...ython/lsst/pipe/base/tests/mocks/_storage_class.py 15.38% 20 Missing and 2 partials ⚠️
python/lsst/pipe/base/_task_metadata.py 23.07% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
- Coverage   82.51%   82.25%   -0.26%     
==========================================
  Files          92       92              
  Lines       10430    10460      +30     
  Branches     1971     1977       +6     
==========================================
- Hits         8606     8604       -2     
- Misses       1483     1511      +28     
- Partials      341      345       +4     

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

@TallJimbo
Copy link
Member Author

I have no idea why the doc build is trying to build docs for Pydantic itself (that seems to be what it's failing on), or why it's a problem here but not in daf_butler.

@TallJimbo TallJimbo force-pushed the tickets/DM-42302 branch 2 times, most recently from 49e2508 to a512a07 Compare December 21, 2023 22:26
@TallJimbo
Copy link
Member Author

I've added some trivial forwarders to public classes that inherit from pydantic.BaseModel, to just override the docstrings so they aren't inherited. It's not at all pretty, but it gets us through without having to weaken our guards against problems in our own docs.

It's hard for me to believe that automodapi is really designed to assume that it should parse the docstrings from any third-party classes that inherited from in its targeted package as rST, with no way to turn it off, but I can find no evidence that anyone else has run into this before.

@TallJimbo TallJimbo marked this pull request as ready for review January 3, 2024 16:49
Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

The sphinx fixes are pretty bad but seem pragmatic for now.

This version claims to be compatible with Pydantic v2 and it works for
daf_butler, though there are reasons to doubt it's fully compatible.
This isn't pretty at all, but I have yet to find another way.
@TallJimbo TallJimbo merged commit 3bc6aad into main Jan 4, 2024
13 of 15 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-42302 branch January 4, 2024 15:14
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.

None yet

2 participants