-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add blogpost for pydantic v2 #2492
Conversation
Co-authored-by: J. Nick Koston <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
blog/2024-12-10-pydantic.md
Outdated
|
||
Pydantic is a widely used library in Python for data validation. On June 30, 2023, Pydantic v2 was released, introducing significant changes that are not backward compatible with Pydantic v1. | ||
|
||
Home Assistant Core 2024.12 continues to ship with the Pydantic v1 library. Over the past year, our community has worked hard to ensure that the libraries used by Home Assistant Core are compatible with both Pydantic v1 and v2. This dual compatibility has helped make our transition to Pydantic v2 as smooth as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Home Assistant Core 2024.12 continues to ship with the Pydantic v1 library. Over the past year, our community has worked hard to ensure that the libraries used by Home Assistant Core are compatible with both Pydantic v1 and v2. This dual compatibility has helped make our transition to Pydantic v2 as smooth as possible. | |
Over the past year, our community has worked hard to ensure that the libraries used by Home Assistant Core are compatible with both Pydantic v1 and v2. This dual compatibility has helped make our transition to Pydantic v2 as smooth as possible. |
This reads a bit off, perhaps it's not necessary at ll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still have a few subreleases until the end of the year, so I think it might help being explicit here that this only applies from 2025.1 onwards
blog/2024-12-10-pydantic.md
Outdated
author: Joost Lekkerkerker | ||
authorURL: https://github.com/joostlek | ||
authorImageURL: https://avatars.githubusercontent.com/u/7083755?v=4 | ||
title: "Pydantic bump to v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: "Pydantic bump to v2" | |
title: "Pydantic v2 mandatory from Home Assistant Core 2025.1" |
Maybe something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mandatory
sounds like everything should use it, which is incorrect, it's only for pydantic v1-based intergation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I do agree the current one is subpar, so open for other suggestions. We should both be trying to be a reason for action, but also make sure we target the right people
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, poor choice of words.. How about "Dropping support for pydantic v1 in 2025.1"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Moving from Pydantic v1 to v2"? (in 2025.1)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds also good, I'd keep the version somehow in the title as it's a clear indication when the change happens. "End of pydantic v1 support in .." would also work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Moving to Pydantic v2"?
blog/2024-12-10-pydantic.md
Outdated
|
||
Home Assistant Core 2024.12 continues to ship with the Pydantic v1 library. Over the past year, our community has worked hard to ensure that the libraries used by Home Assistant Core are compatible with both Pydantic v1 and v2. This dual compatibility has helped make our transition to Pydantic v2 as smooth as possible. | ||
|
||
Starting with Home Assistant Core 2025.1, Pydantic v2 will replace v1. If your custom integration uses Pydantic, it must be updated to support Pydantic v2 to keep working in the upcoming release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap the order of paragraph 2 and 3? This gets to the action needed sooner on what action needs to happen, then can get into details of how migration works
📝 WalkthroughWalkthroughThe pull request introduces a new blog post discussing the transition from Pydantic v1 to Pydantic v2 for Home Assistant Core. The article, authored by Joost Lekkerkerker, highlights the significant changes in Pydantic's versioning, focusing on the non-backward-compatible nature of Pydantic v2. It explains that Home Assistant Core version 2025.1 will standardize Pydantic v2, requiring updates to custom integrations and providing context about the community's efforts to facilitate a smooth migration. Changes
The changes consist of adding a single new blog post file that provides technical guidance and context for the upcoming Pydantic version transition in the Home Assistant ecosystem. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
blog/2024-12-10-moving-to-pydantic-v2.md (3)
5-5
: Remove quotes from the titleReplace the quoted title with an unquoted one to follow the documentation guidelines.
-title: "Moving to Pydantic v2" +title: Moving to Pydantic v2
10-10
: Consider restructuring for emphasis on impactWhile the content is correct, consider restructuring to emphasize the impact on custom integrations.
-Starting with Home Assistant Core 2025.1, Pydantic v2 will replace v1. If your custom integration uses Pydantic, it must be updated to support Pydantic v2 to keep working in the upcoming release. +Custom integrations using Pydantic must be updated to support v2 to maintain functionality. Home Assistant Core 2025.1 will exclusively use Pydantic v2, replacing v1 completely.
14-14
: Make the migration instruction more directConsider restructuring to provide a more direct instruction.
-For a quick migration, you can use the Pydantic v1 shims included in Pydantic v2. Detailed information about using these shims in a v1/v2 environment can be found in the [Pydantic migration guide](https://docs.pydantic.dev/latest/migration/#using-pydantic-v1-features-in-a-v1v2-environment). +Use the Pydantic v1 shims included in Pydantic v2 for quick migration. Follow the [Pydantic migration guide](https://docs.pydantic.dev/latest/migration/#using-pydantic-v1-features-in-a-v1v2-environment) for detailed instructions on using these shims in a v1/v2 environment.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
blog/2024-12-10-moving-to-pydantic-v2.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
blog/2024-12-10-moving-to-pydantic-v2.md (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
🔇 Additional comments (2)
blog/2024-12-10-moving-to-pydantic-v2.md (2)
8-8
: LGTM!
The introduction is clear, concise, and effectively communicates the context.
12-12
: LGTM!
The context is well-explained and provides valuable information about the transition period.
Proposed change
Add blogpost for pydantic v2
Type of change
Additional information
Summary by CodeRabbit