Closed ericmjl closed 3 months ago
The issue with pkg_resources
is fixed in master
with this commit: https://github.com/econchick/interrogate/commit/3aa94a6a9d6dca0a015d97ef389feb788cb466dd
In the commit, import pkg_resources
was replaced with from importlib import resources
. I suspect this issue will be resolved when 1.6.0 is released.
Any update on this issue's release date please?
released 1.6.0! closing this issue, but if it isn't fixed, feel free to re-open.
Environment
interrogate
version(s): 1.5.0, as a pre-commit hookDescription of the bug
When running
pre-commit
withinterrogate
as one of the hooks, theinterrogate
hook fails with aModuleNotFoundError
forpkg_resources
.The traceback ends with:
What you expected to happen
interrogate
should execute successfully when invoked as a hook inpre-commit
, without any module import errors.How to reproduce (as minimally and precisely as possible)
pre-commit
with a.pre-commit-config.yaml
that includesinterrogate
as one of the hooks.pre-commit run --all-files
.The error occurs during the
interrogate
hook.Anything else we need to know?
The issue seems to stem from a couple of interrelated issues:
pre-commit
defaults to using the latest Python version available, which, as of October 29, 2023, is version 3.12.setuptools
by default when a new virtual environment is created, thereby causing the absence ofpkg_resources
.interrogate
should explicitly depend onsetuptools
.I discovered this issue because of my CI/CD pipelines failing. One example is in LlamaBot, linked here.