Package version (if known): 2.1.1
Describe the bug
Parts of Invenio use uritemplate library which provides python package uritemplate.
This library (and invenio-github as well) have dependency to uritemplate.py that provides the
same package - thus the one used is determined by the order in which libraries are installed (not deterministic).
For python 3.9 it seems that Invenio works with both implementations, but for python 3.10
uritemplate.py<2 is broken.
Steps to Reproduce
Install Invenio and reinstall uritemplate.py. Then run any test that uses uri template (for example service.scan):
/invenio_records_resources/services/records/results.py:199: in hits
projection["links"] = self._links_item_tpl.expand(
....
/opt/hostedtoolcache/Python/3.10.10/x64/lib/python3.10/site-packages/uritemplate/variable.py:278: in _string_expansion
if dict_test(value) or tuples:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = 'as9k9-0nr40'
def dict_test(value):
> return isinstance(value, (dict, collections.MutableMapping))
E AttributeError: module 'collections' has no attribute 'MutableMapping'
Expected behavior
If possible, only uritemplate library should be used throughout invenio.
Workaround
We currently use the following workaround:
pip install -e '.[tests]'
pip install -e 'tests/records2'
pip uninstall -y uritemplate
pip install uritemplate
export PYTHONPATH=.
pytest tests
Package version (if known): 2.1.1
Describe the bug
Parts of Invenio use
uritemplatelibrary which provides python packageuritemplate.This library (and invenio-github as well) have dependency to
uritemplate.pythat provides thesame package - thus the one used is determined by the order in which libraries are installed (not deterministic).
For python 3.9 it seems that Invenio works with both implementations, but for python 3.10
uritemplate.py<2 is broken.
Steps to Reproduce
Install Invenio and reinstall uritemplate.py. Then run any test that uses uri template (for example service.scan):
Expected behavior
If possible, only
uritemplatelibrary should be used throughout invenio.Workaround
We currently use the following workaround: