linkml / schema-automator

Automated assistance for the schema development lifecycle
https://linkml.io/schema-automator/
BSD 3-Clause "New" or "Revised" License
33 stars 12 forks source link

PyDantic update causes pip dependency's imcompatibility. #122

Open LicoriceLin opened 7 months ago

LicoriceLin commented 7 months ago

Describe the bug PyDantic update causes pip dependency's imcompatibility. with pydantic=2.5 (default pip behavior) raise error like: ... ... File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/bioregistry/schema/__init__.py", line 5, in <module> from .struct import ( # noqa:F401 File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/bioregistry/schema/struct.py", line 35, in <module> from bioregistry.utils import curie_to_str, deduplicate, removeprefix, removesuffix File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/bioregistry/utils.py", line 25, in <module> from pydantic.json import ENCODERS_BY_TYPE ImportError: cannot import name 'ENCODERS_BY_TYPE' from 'pydantic.json' (/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.

downgrade to pydantic 1.1 causes oaklib import error like:

... ... File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/schema_automator/annotators/schema_annotator.py", line 10, in <module> from oaklib import BasicOntologyInterface File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/oaklib/__init__.py", line 9, in <module> from oaklib.selector import get_implementation_from_shorthand # noqa:F401 File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/site-packages/oaklib/selector.py", line 8, in <module> ... ... File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis File "/home/rnalab/zfdeng/miniconda3/envs/tmp_schema/lib/python3.9/typing.py", line 852, in __subclasscheck__ return issubclass(cls, self.__origin__) TypeError: issubclass() arg 1 must be a class

To Reproduce begin with a new conda env with only python3.9 pip install schema-automator run any cli commands.

dosumis commented 7 months ago

This is a blocker for me too.