Relax Pydantic Version Requirements #11
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pydantic v2 has been around for nearly 2 years, and as such many things use the new version.
tcexand the associated repositories related to it all have a strict<2.0.0requirement on Pydantic, which is problematic when trying to utilize these libraries in a larger application or ecosystem which uses a newer version of Pydantic.This PR and a collection of others I am in the process of making together aim to relax the version requirements for Pydantic by utilizing the
pydantic.v1namespace introduced inv1.10.17. Thispyandic.v1namespace allows users to utilize Pydantic as it was in v1 even when v2 is installed. It is explicitly listed as an option in the official Migration Guide.I plan to place this same PR description across all repositories which I found that needed updating, so here's some overarching information about this process as I have been able to understand it:
tcex,tcex-cli, andtcex-app-testing.pyproject.tomlupdated to relax the requirements to>=1.10.17,<3.0.0.tcex-app-config,tcex-app-playbook,tcex-util.pydanticupdated to referencepydantic.v1.This is all relatively straightforward. In the forks I have made, I've run the following straightforward one-liner to replace all
from pydantic...lines appropriately:For repositories with submodules (the primary repositories mentioned above), I filtered out the submodule paths before making this replacement. After the secondary repositories are merged, the primary repository submodules will also need to be updated to account for these changes in the primary repositories as well.
I will be the first to admit that I am not the best person to test all of this as I'm not intimately familiar with
tcexor all the in's and out's of your application(s). But I am familiar with Pydantic, and this version conflict is a bump in the road for me, so I'm happy to work through troubleshooting. I'm happy to discuss options and work with the team, but given that this was just a bunch of find-and-replace followed by careful coordination of submodules, I figured I'd at least get the ball rolling.Once all six of the PRs are open, I'll go back through and make a comment on each to reference the others so they can be properly tracked/linked.