Skip to content

Depends on incompatible version of pydantic #57

@paul121

Description

@paul121

Describe the bug
Since the release of pydantic 2.0 the following error is seen after doing pip install farmOS>=1.0 and running a script that imports farmOS:

>>> from farmOS import farmOS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/farmos-py-test/venv/lib/python3.10/site-packages/farmOS/__init__.py", line 6, in <module>
    from . import client, client_2, subrequests
  File "/tmp/farmos-py-test/venv/lib/python3.10/site-packages/farmOS/subrequests.py", line 71, in <module>
    class SubrequestsBlueprint(BaseModel):
  File "/tmp/farmos-py-test/venv/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 98, in __new__
    private_attributes = inspect_namespace(
  File "/tmp/farmos-py-test/venv/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 291, in inspect_namespace
    raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'")
TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'

I believe we just need to change our specifier for pydantic to use the compatible release version specifier ~: pydantic~=1.7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions