You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mongomock uses setuptools unconditionally. However, setuptools (which provides pkg_resources) is not stdlib, and it is not guaranteed to be there. So it needs to be specified as a dependency, otherwise users can get:
$ python3 -c 'import mongomock'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/.../.venv/lib/python3.9/site-packages/mongomock/__init__.py", line 79, in <module>
from mongomock.__version__ import __version__
File "/.../.venv/lib/python3.9/site-packages/mongomock/__version__.py", line 1, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
The current depenency tree is missing setuptools:
$ johnnydep mongomock==4.1.2
name summary
---------------- -----------------------------------------------------------
mongomock==4.1.2 Fake pymongo stub for testing simple MongoDB-dependent code
├── packaging Core utilities for Python packages
└── sentinels Various objects to denote special meanings in python
The alternative would be to stop importing pkg_resources, which is deprecated anyway (#848), and use stdlib importlib.metadata to retrieve the installed version instead.
The text was updated successfully, but these errors were encountered:
wimglenn
changed the title
mongomock needs to declare dependency on setuptools
mongomock needs to declare dependency on setuptools (or stop using it)
Jul 6, 2023
Mongomock uses setuptools unconditionally. However, setuptools (which provides
pkg_resources
) is not stdlib, and it is not guaranteed to be there. So it needs to be specified as a dependency, otherwise users can get:The current depenency tree is missing setuptools:
The alternative would be to stop importing
pkg_resources
, which is deprecated anyway (#848), and use stdlibimportlib.metadata
to retrieve the installed version instead.The text was updated successfully, but these errors were encountered: