biolink / ontobio

python library for working with ontologies and ontology associations
https://ontobio.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
118 stars 30 forks source link

pyparsing upgrade causes AttributeError #605

Closed dustine32 closed 2 years ago

dustine32 commented 2 years ago

On a fresh pip install -r requirements.txt and running make travis_test we now get this error:

__________________________________ ERROR collecting tests/test_gocamgen.py ___________________________________
tests/test_gocamgen.py:6: in <module>
    from ontobio.rdfgen.gocamgen import collapsed_assoc, gocam_builder, gocamgen
ontobio/rdfgen/gocamgen/gocam_builder.py:1: in <module>
    from ontobio.rdfgen.gocamgen.gocamgen import AssocGoCamModel
ontobio/rdfgen/gocamgen/gocamgen.py:17: in <module>
    from ontobio.rdfgen.gocamgen.subgraphs import AnnotationSubgraph
ontobio/rdfgen/gocamgen/subgraphs.py:3: in <module>
    from ontobio.rdfgen.gocamgen.rdflib_sparql_wrapper import RdflibSparqlWrapper
ontobio/rdfgen/gocamgen/rdflib_sparql_wrapper.py:2: in <module>
    from rdflib.plugins.sparql import prepareQuery
env/lib/python3.6/site-packages/rdflib/plugins/sparql/__init__.py:33: in <module>
    from . import parser
env/lib/python3.6/site-packages/rdflib/plugins/sparql/parser.py:184: in <module>
    Param('prefix', PN_PREFIX)) + Suppress(':').leaveWhitespace()
env/lib/python3.6/site-packages/rdflib/plugins/sparql/parserutils.py:114: in __init__
    self.name = name
E   AttributeError: can't set attribute

This issue also occurred in the GO pipeline: https://github.com/geneontology/pipeline/issues/253

Module pyparsing had upgraded to 3.0.6. Pinning this module with pyparsing==2.4.7 fixes the error.

dustine32 commented 2 years ago

Actually, @sierra-moxon's recent commit 84331c2ad441a21eb71f04a1af62970fcb2a9c92 just fixed this. Thanks @sierra-moxon!