Skip to content

Unpin pydantic #646

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

Closed
ringohoffman opened this issue Jul 19, 2023 · 2 comments
Closed

Unpin pydantic #646

ringohoffman opened this issue Jul 19, 2023 · 2 comments
Assignees
Labels
feature A new feature or a feature request

Comments

@ringohoffman
Copy link
Contributor

Description

python-semantic-release 8.0.2 depends on pydantic<2 and >=1.10.2

Use cases

This would support consumers who depend on pydantic>2.0.

Possible implementation

It seems like this code base mostly relies on basic pydantic.dataclasses.dataclass and pydantic.BaseModelfunctionality, so I would bet that we could just unpin pydantic and it would still work.

@ringohoffman ringohoffman added the feature A new feature or a feature request label Jul 19, 2023
@bernardcooke53 bernardcooke53 self-assigned this Jul 19, 2023
@bernardcooke53
Copy link
Contributor

Hey @ringohoffman - I took a cursory look at upgrading to pydantic v2, it wasn't just a straight upgrade (I had some trouble with the nested configuration models for default configuration) but definitely something that's high on the list!

@bernardcooke53
Copy link
Contributor

Re upgrade: I noticed the following:
After pydantic/pydantic#6722 I realised tomlkit parsed into its own types rather than builtin Python types, and Pydantic V2 isn't coercing them like v1 so it "looks like" valid TOML is invalid according to the Config model.

I tried swapping tomlkit for tomli and tomli-w, as tomli does parse TOML into builtin Python types - however, tomli_w reformatted the TOML file when it was written out. Maybe not the worst crime but I was reluctant to just throw that in. I didn't really want to use two TOML parsing libraries (especially as there's also a builtin one in 3.11+), so need to figure a way out to make all these things work together - hoping there's a "coerce" setting for pydantic v2 models that I've missed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or a feature request
Projects
None yet
Development

No branches or pull requests

2 participants