Knowledge-Graph-Hub / kg-phenio

A Graph for experiments doing ML on ontologies.
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Further dependency fixes to avoid incompatibilities #129

Closed caufieldjh closed 6 months ago

caufieldjh commented 6 months ago

Strangely, I know get this Pydantic-flavored error locally:

>>> import importlib
>>> importlib.import_module("biolink.pydanticmodel")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/harry/kg-phenio/.venv/lib/python3.9/site-packages/biolink/pydanticmodel.py", line 19, in <module>
    class ConfiguredBaseModel(WeakRefShimBaseModel,
  File "/home/harry/kg-phenio/.venv/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 117, in __new__
    cls: type[BaseModel] = super().__new__(mcs, cls_name, bases, namespace, **kwargs)  # type: ignore
  File "/usr/lib/python3.9/abc.py", line 106, in __new__
    cls = super().__new__(mcls, name, bases, namespace, **kwargs)
TypeError: ConfiguredBaseModel.__init_subclass__() takes no keyword arguments

and that's with pydantic 2.5.2

caufieldjh commented 6 months ago

Ah, that's because it needs to be this one now: https://github.com/biolink/biolink-model/blob/master/src/biolink_model/datamodel/pydanticmodel_v2.py