Skip to content

Unpin pydantic #646

Description

@ringohoffman

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.

Activity

  1. bernardcooke53 commented on Jul 19, 2023

    @bernardcooke53
    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!

  2. bernardcooke53 commented on Jul 26, 2023

    @bernardcooke53
    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

Metadata

Metadata

Labels

featureA new feature or a feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions