Comment 2 for bug 2017719

Revision history for this message
Navum Gupta (navum) wrote (last edit ):

while doing execution of compliance test in ubunty-Jammy machines, it raised similar error importerror: cannot import name ‘mapping’ from ‘collections’, it occurs while importing Mapping class from collections module in higher version of python (3.10 +).

In python 3.10 + version Mapping class is now moved in collections.abc class and in most of the case we do not know the run time version of python.

And Ubuntu-Jammy by default uses python 3.10 as its run time version so, if we upgrade `robotframework` = 3.2 in `requirements.txt` file our issue gets resolved because if we check [2] it calls 'from collections.abc import Mapping'.

Moreover, the current robot framework version (`robotframework==3.1`) mentioned in ‘requirement.txt’ file of api-tests repository calls - "from collections import Mapping" - [1], but this robotframework version perfectly works with Python 3.9 or lower.

[1]https://github.com/robotframework/robotframework/blob/v3.2/src/robot/utils/robottypes3.py#L16
[2]https://github.com/robotframework/robotframework/blob/v3.1/src/robot/utils/robottypes3.py#L16

we have also opened bug in NFV-TST side to upgrade robotframework version from v3.1 to v3.2 in requirements.txt
[3]https://forge.etsi.org/rep/nfv/api-tests/-/issues/201