-
Notifications
You must be signed in to change notification settings - Fork 849
Description
Describe your environment
I'm running Python 3.8.10 on Ubuntu 20.04 (but it shouldn't make a difference here).
Additional Context
I believe that setuptools recently moved from a buildtime dependency to a runtime dependency in #738.
Direct references to pkg_resources were added outside of the build context here:
In most cases individuals are unlikely to encounter a problem because they had to have setuptools present to pip install in the first place.
There are cases where this could be a problem, for example:
- A multi-stage Docker build where pip-installed packages are copied to a new image that does not include packaging tools.
- Using a build system, eg. pants where artifacts are designed to be isolated from the system python environment.
Essentially, any case that involves creating an artifact with pip install -t is open to an import error:
ModuleNotFoundError: No module named 'pkg_resources'
I'm opening this issue to discuss whether setuptools should be added to install_requires here:
There are workarounds for the cases that don't support the current setup.cfg, but I've encountered this with relatively few packages and figured it might be worth a look. I can open the PR if it is.