farmOS / farmOS.py

A Python library for interacting with farmOS over API.
GNU General Public License v3.0
27 stars 12 forks source link

Depends on incompatible version of pydantic #57

Closed paul121 closed 1 year ago

paul121 commented 1 year ago

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