Skip to content

Use Pydantic v2 API models; remove support for Pydantic V1#1549

Merged
elliotgunton merged 10 commits intomainfrom
generate-v2-models
Feb 9, 2026
Merged

Use Pydantic v2 API models; remove support for Pydantic V1#1549
elliotgunton merged 10 commits intomainfrom
generate-v2-models

Conversation

@elliotgunton
Copy link
Copy Markdown
Collaborator

Pull Request Checklist

Description of PR
Currently, the API models are using Pydantic V1. This PR updates the codegen script to create V2 models, and tidies up the code that uses them. It also adds 3.14 to the cicd matrix and removes the Pydantic V1 checks.

@elliotgunton elliotgunton mentioned this pull request Jan 21, 2026
4 tasks
@elliotgunton elliotgunton added type:enhancement A general enhancement semver:major A change requiring a major version bump type:task A general task (including refactors) and removed type:enhancement A general enhancement labels Jan 21, 2026
Copy link
Copy Markdown
Collaborator

@jeongukjae jeongukjae left a comment

Choose a reason for hiding this comment

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

Mainly nit comments. Looks good!

Comment thread examples/workflows/experimental/new_decorators_fanout_loop.py Outdated
Comment thread pyproject.toml
Comment thread src/hera/workflows/io/_io_mixins.py Outdated
Comment thread src/hera/workflows/io/_io_mixins.py Outdated
Comment thread src/hera/workflows/io/_io_mixins.py Outdated
Comment thread src/hera/workflows/_runner/script_annotations_util.py
Comment thread src/hera/workflows/_meta_mixins.py Outdated
@elliotgunton elliotgunton force-pushed the migrate-mixin-classes branch 2 times, most recently from 27c715f to 57be54b Compare January 29, 2026 22:02
@elliotgunton elliotgunton force-pushed the generate-v2-models branch 2 times, most recently from 7afe71d to 684a244 Compare February 3, 2026 11:49
Base automatically changed from migrate-mixin-classes to main February 4, 2026 14:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 88.43931% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.1%. Comparing base (df93a1c) to head (678084b).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
src/hera/workflows/io/v1.py 75.7% 5 Missing and 3 partials ⚠️
src/hera/workflows/_mixins.py 37.5% 5 Missing ⚠️
src/hera/workflows/io/_io_mixins.py 90.0% 1 Missing and 1 partial ⚠️
src/hera/workflows/steps.py 33.3% 2 Missing ⚠️
src/hera/_cli/generate/python.py 94.7% 0 Missing and 1 partial ⚠️
src/hera/shared/serialization.py 66.6% 0 Missing and 1 partial ⚠️
src/hera/workflows/volume.py 50.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1549     +/-   ##
=======================================
- Coverage   81.3%   81.1%   -0.2%     
=======================================
  Files         63      63             
  Lines       5362    5368      +6     
  Branches     825     826      +1     
=======================================
- Hits        4361    4357      -4     
- Misses       852     858      +6     
- Partials     149     153      +4     

☔ View full report in Codecov by Sentry.
📢 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.

@elliotgunton elliotgunton changed the title Generate v2 API models Generate v2 API models, remove v1 support for 3.14 and above Feb 6, 2026
@elliotgunton elliotgunton changed the title Generate v2 API models, remove v1 support for 3.14 and above Generate v2 API models; remove v1 support for 3.14 and above Feb 6, 2026
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* Missed some V1/V2 imports around `io`
* Also simplified Annotated import as lowest supported Python version is now 3.10

Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
* Remove Pydantic "email" extra
* Remove forward ref types

Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
@elliotgunton elliotgunton force-pushed the generate-v2-models branch 3 times, most recently from dd464e1 to c1c4eb5 Compare February 8, 2026 13:06
@elliotgunton elliotgunton force-pushed the generate-v2-models branch 2 times, most recently from 4df48f8 to 27ac3c9 Compare February 8, 2026 14:04
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Copy link
Copy Markdown
Collaborator

@jeongukjae jeongukjae left a comment

Choose a reason for hiding this comment

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

🚀

@elliotgunton elliotgunton merged commit 3f0deb9 into main Feb 9, 2026
21 checks passed
@elliotgunton elliotgunton deleted the generate-v2-models branch February 19, 2026 20:42
@elliotgunton elliotgunton added type:informational Provides information or notice to the community and removed type:task A general task (including refactors) labels Mar 19, 2026
@elliotgunton elliotgunton changed the title Generate v2 API models; remove v1 support for 3.14 and above Use Pydantic v2 API models; remove support for Pydantic V1 Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major A change requiring a major version bump type:informational Provides information or notice to the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Hera classes and related internals off Pydantic V1 Python 3.14 is not supported due to Pydantic V1

2 participants