NiklasRosenstein / slap

Slap is a CLI to assist in the process for developing and releasing Python packages.
https://niklasrosenstein.github.io/slap/
Other
18 stars 11 forks source link

Fix `The 'importlib-resources; python_version < "3.9"' distribution was not found and is required by keyring` #108

Closed NiklasRosenstein closed 5 months ago

NiklasRosenstein commented 5 months ago

In CI when using the GHA install action, we get this error always when running slap:

Traceback (most recent call last):
  File "/opt/pipx/venvs/slap-cli/lib/python3.10/site-packages/slap/application.py", line 249, in load_plugins
    plugin = loader()(self)
  File "/opt/pipx/venvs/slap-cli/lib/python3.10/site-packages/nr/util/plugins/_pkg_resources.py", line 78, in loader
    value = ep.load()
  File "/opt/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2442, in load
    self.require(*args, **kwargs)
  File "/opt/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2465, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/opt/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'importlib-resources; python_version < "3.9"' distribution was not found and is required by keyring

The resolution is to not rely on pkg_resources anymore.