You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggested fixes here is to change the dataclasses requirement to only install for <python3.7 with: (PR with fix: #631)
dataclasses>='0.7';python_version<'3.7'
To replicate the issue:
❯ docker run --rm -it python:3.7 sh -c 'pip install ontobio && python'
[... docker & pip installer output removed for brevity ...]
Python 3.7.16 (default, Mar 14 2023, 03:47:39)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages']
>>> # Simulate environment where pip installed site-packages comes before stdlib packages
>>> sys.path.reverse()
>>> sys.path
['/usr/local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7', '/usr/local/lib/python37.zip', '']
>>>
>>> import ontobio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/ontobio/__init__.py", line 6, in <module>
from .ontol_factory import OntologyFactory
File "/usr/local/lib/python3.7/site-packages/ontobio/ontol_factory.py", line 7, in <module>
import ontobio.obograph_util as obograph_util
File "/usr/local/lib/python3.7/site-packages/ontobio/obograph_util.py", line 8, in <module>
from ontobio.golr.golr_associations import search_associations
File "/usr/local/lib/python3.7/site-packages/ontobio/golr/golr_associations.py", line 13, in <module>
from ontobio.golr.golr_query import *
File "/usr/local/lib/python3.7/site-packages/ontobio/golr/golr_query.py", line 48, in <module>
from ontobio.model.GolrResults import SearchResults, AutocompleteResult, Highlight
File "/usr/local/lib/python3.7/site-packages/ontobio/model/GolrResults.py", line 5, in <module>
@dataclass(frozen=True)
File "/usr/local/lib/python3.7/site-packages/dataclasses.py", line 950, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "/usr/local/lib/python3.7/site-packages/dataclasses.py", line 801, in _process_class
for name, type in cls_annotations.items()]
File "/usr/local/lib/python3.7/site-packages/dataclasses.py", line 801, in <listcomp>
for name, type in cls_annotations.items()]
File "/usr/local/lib/python3.7/site-packages/dataclasses.py", line 659, in _get_field
if (_is_classvar(a_type, typing)
File "/usr/local/lib/python3.7/site-packages/dataclasses.py", line 550, in _is_classvar
return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'
The text was updated successfully, but these errors were encountered:
When the
pip packages
are higher priority thanstdlib
packages, importingontobio
fails because the dataclasses package is broken >=Python 3.7.ontobio
depends on dataclasses package directly.Suggested fixes here is to change the
dataclasses
requirement to only install for <python3.7 with: (PR with fix: #631)To replicate the issue:
The text was updated successfully, but these errors were encountered: