Skip to content

Pydantic v2#1197

Draft
sezanzeb wants to merge 10 commits intomainfrom
pydanticv2
Draft

Pydantic v2#1197
sezanzeb wants to merge 10 commits intomainfrom
pydanticv2

Conversation

@sezanzeb
Copy link
Owner

@sezanzeb sezanzeb commented Nov 1, 2025

v1 is not completely compatible with 3.14, and might break soon.

It seems for now this is not critical for input-remapper. Fedora users have reported that it works with that other recent fix.

@sezanzeb sezanzeb changed the title Pydanticv2 Nov 1, 2025
use_enum_values = True
underscore_attrs_are_private = True
json_encoders = {InputCombination: lambda v: v.json_key()}
Cfg = ConfigDict(
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Extra key "underscore_attrs_are_private" for TypedDict "ConfigDict" [typeddict-unknown-key]


class ImmutableCfg(Cfg):
allow_mutation = False
ImmutableCfg = ConfigDict(
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Extra key "allow_mutation" for TypedDict "ConfigDict" [typeddict-unknown-key]


if output_type != EV_KEY and output_code is not None and not output_symbol:
values["mapping_type"] = MappingType.ANALOG.value
self.mapping_type = MappingType.ANALOG.value
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Incompatible types in assignment (expression has type "str", variable has type "MappingType | None") [assignment]


if output_type is None and output_code is None and output_symbol:
values["mapping_type"] = MappingType.KEY_MACRO.value
self.mapping_type = MappingType.KEY_MACRO.value
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Incompatible types in assignment (expression has type "str", variable has type "MappingType | None") [assignment]

values["mapping_type"] = MappingType.KEY_MACRO.value

return values
self.mapping_type = MappingType.KEY_MACRO.value
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Incompatible types in assignment (expression has type "str", variable has type "MappingType | None") [assignment]

@root_validator
def validate_output_symbol_variant(cls, values):
@model_validator(mode="after")
def validate_output_symbol_variant(self) -> Self:
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Name "Self" is not defined [name-defined]

return self

@model_validator(mode="after")
def validate_output_integrity(self) -> Self:
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Name "Self" is not defined [name-defined]

return self

@model_validator(mode="after")
def output_matches_input(self) -> Self:
Copy link

Choose a reason for hiding this comment

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

[mypy] reported by reviewdog 🐶
error: Name "Self" is not defined [name-defined]

@sezanzeb
Copy link
Owner Author

sezanzeb commented Nov 1, 2025

python3-pydantic-core is not available in ubuntu 24.04 LTS.

24.04 still has pydantic v1.

I don't think I want to stop supporting 24.04 yet, and therefore want to delay the switch to pydantic v2.

Python 3.15 will be released on 2026-10-01 or something (https://peps.python.org/pep-0790/), so in about a year. It remains to be seen if pydantic v1 breaks with that release for input-remapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant