Skip to content

Pydantic v2 support #46

@abuchnick-aiola

Description

@abuchnick-aiola

Copying here an issue posted originally on Rocketry, just for the integrity and the tracking - since the problem stems from red-bird.
Miksus/rocketry#210

Is your feature request related to a problem? Please describe.
red-bird is not compatible with Pydantic V2

Describe the solution you'd like
Update Red-Bird (if it is still maintained) to use Pydantic V2

Describe alternatives you've considered
None

Additional context
Pydantic V2 was released on June 30th, and ever since red-bird and Rocketry are not usable.
Traceback for example:

Traceback (most recent call last):
  File "/app/main.py", line 5, in <module>
    from rocketry import Rocketry
  File "/usr/local/lib/python3.9/site-packages/rocketry/__init__.py", line 1, in <module>
    from .session import Session
  File "/usr/local/lib/python3.9/site-packages/rocketry/session.py", line 18, in <module>
    from rocketry.log.defaults import create_default_handler
  File "/usr/local/lib/python3.9/site-packages/rocketry/log/defaults.py", line 1, in <module>
    from redbird.logging import RepoHandler
  File "/usr/local/lib/python3.9/site-packages/redbird/__init__.py", line 2, in <module>
    from .base import BaseRepo, BaseResult
  File "/usr/local/lib/python3.9/site-packages/redbird/base.py", line 116, in <module>
    class BaseRepo(ABC, BaseModel):
  File "/usr/local/lib/python3.9/site-packages/redbird/base.py", line 153, in BaseRepo
    ordered: bool = Field(default=False, const=True)
  File "/usr/local/lib/python3.9/site-packages/pydantic/fields.py", line 675, in Field
    raise PydanticUserError('`const` is removed, use `Literal` instead', code='removed-kwargs')
pydantic.errors.PydanticUserError: `const` is removed, use `Literal` instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions