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
Traceback (most recent call last):
File "/tmp/pytest-of-runner/pytest-0/test_packaging_bdist_wheel_whl0/bin/opensafely", line 5, in <module>
from opensafely import main
File "/tmp/pytest-of-runner/pytest-0/test_packaging_bdist_wheel_whl0/lib/python3.12/site-packages/opensafely/__init__.py", line 10, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
This doesn't just affect the test because opensafely/__init__.py does the same.
The quick fix is:
easy_install, pkg_resources, setuptools and distutils are no longer provided by default in environments created with venv or bootstrapped with ensurepip, since they are part of the setuptools package. For projects relying on these at runtime, the setuptools project should be declared as a dependency and installed separately (typically, using pip).
This doesn't just affect the test because
opensafely/__init__.py
does the same.The quick fix is:
https://docs.python.org/3/whatsnew/3.12.html#ensurepip
But a better alternative would be removing the use of
pkg_resources
, if possible. The use ofpkg_resources
is deprecated in setuptools.The text was updated successfully, but these errors were encountered: