At tag v1.3.0, main.py imports CONTENT_TYPE_MAP from code.constants only in its __main__ branch; the package-import branch (the else clause) omits it. Any library use that reaches _validate_with_cmr raises a NameError at main.py line 189:
from pyQuARC import ARC
ARC(input_concept_ids=["C1991543732-POCLOUD"]).validate()
# NameError: name 'CONTENT_TYPE_MAP' is not defined
The CLI path is unaffected (its branch imports the constant), which is probably why this went unnoticed.
Reproduction: Python 3.11, pip install git+https://github.com/NASA-IMPACT/pyQuARC@v1.3.0, then the two lines above with any real collection concept id.
The fix looks like a one-liner: add CONTENT_TYPE_MAP to the package-branch import list in main.py.
We currently work around it in our attestation harness by binding the name from pyQuARC.code.constants before calling validate(), with the tag pin untouched. The smoke run that hit it is documented at open-science-pillars/marketplace#22 (receipt d9408d9e).
Thanks for pyQuARC; happy to open a PR for the import fix if useful.
At tag v1.3.0,
main.pyimportsCONTENT_TYPE_MAPfromcode.constantsonly in its__main__branch; the package-import branch (theelseclause) omits it. Any library use that reaches_validate_with_cmrraises a NameError at main.py line 189:The CLI path is unaffected (its branch imports the constant), which is probably why this went unnoticed.
Reproduction: Python 3.11,
pip install git+https://github.com/NASA-IMPACT/pyQuARC@v1.3.0, then the two lines above with any real collection concept id.The fix looks like a one-liner: add
CONTENT_TYPE_MAPto the package-branch import list in main.py.We currently work around it in our attestation harness by binding the name from
pyQuARC.code.constantsbefore callingvalidate(), with the tag pin untouched. The smoke run that hit it is documented at open-science-pillars/marketplace#22 (receipt d9408d9e).Thanks for pyQuARC; happy to open a PR for the import fix if useful.