Skip to content
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

fix: Constrain the minimum bound of pydantic. #389

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

DanCardin
Copy link
Contributor

Alternatively, I could alter your uses of Field() which do not set a default value. But the code as-is appears to be incompatible with pydantic before 1.5, where it raises errors like:

    @all_fields_optional
    class ContainerDeviceRequest(DockerCamelModel):
        driver: str
        count: int
>       device_ids: List[str] = pydantic.Field(alias="DeviceIDs")
E       TypeError: Field() missing 1 required positional argument: 'default'

.venv/lib/python3.10/site-packages/python_on_whales/components/container/models.py:64: TypeError

Likely for all these cases, the default could be set to ..., but you have a decent number of Field usages, and this seemed less invasive a solution reflecting the current state of the code base.

Copy link
Owner

@gabrieldemarmiesse gabrieldemarmiesse left a comment

Choose a reason for hiding this comment

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

I do agree with the change, thank you for making it :) we don't have the manpower in this project to alter the codebase to support very old versions of python or packages in general so it's better to be stricter with the requirements indeed

@gabrieldemarmiesse gabrieldemarmiesse enabled auto-merge (squash) November 30, 2022 22:28
@gabrieldemarmiesse gabrieldemarmiesse merged commit bc9a3cb into gabrieldemarmiesse:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants