_______________________________________________ ERROR collecting tests/unit/test_ubuntu_repository_cache.py _______________________________________________
ImportError while importing test module '/tmp/tmpfiles-hloeung/tmp/ubuntu-repository-cache/tests/unit/test_ubuntu_repository_cache.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/test_ubuntu_repository_cache.py:19: in <module>
from reactive import ubuntu_repository_cache # NOQA: E402
reactive/ubuntu_repository_cache.py:15: in <module>
from charms import reactive
.tox/unit/lib/python3.12/site-packages/charms/reactive/__init__.py:21: in <module>
from .relations import * # noqa
.tox/unit/lib/python3.12/site-packages/charms/reactive/relations.py:32: in <module>
from pkg_resources import iter_entry_points
E ModuleNotFoundError: No module named 'pkg_resources'
Attention
Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.
Hi,
I'm seeing this in charms.reactive v1.5.3:
I think this is related to the recent PR - https://github.com/canonical/charms.reactive/pull/260
Isn't
pkg_resources
meant to be deprecated? https://setuptools.pypa.io/en/latest/pkg_resources.html says: