mongomock feature not working with pymongo 4.9.0
Installation of the vre-language with mongomock support, as shown in the Quickstart guide, will result in the following error at the moment of reseting the launchpad:
File "/home/rodri/Programs/miniconda3/envs/vrel-mmock/lib/python3.9/unittest/mock.py", line 1377, in get_original
raise AttributeError(
AttributeError: <module 'gridfs' from '/home/rodri/Programs/miniconda3/envs/vrel-mmock/lib/python3.9/site-packages/gridfs/__init__.py'> does not have the attribute 'Database'
The problem seems to be caused by the newer pymongo 4.9.x
releases.
If the package is downgraded to 4.8.0, or previous, the feature works as expected.
NOTE: around the time of the implementation of the mongomock support, pymongo 4.7.2 and 4.7.3 were available.
A couple of possile quick fixes:
- pin the version of pymongo to 4.8.0 in setup.cfg;
- add a step to the instruction explicitly indicating the pymongo version to install:
python -m pip install --upgrade pip
python -m pip install "pymongo<4.9.0" <<<--- THIS!
python -m pip install git+https://github.com/materialsproject/fireworks.git
python -m pip install vre-language[mongomock]
In any case, this might require further changes to maintain support for the mongomock feature.