Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should "setuptools" be a runtime dependency of opentelemetry-api and opentelemetry-sdk? #2282

Closed
aaronslin opened this issue Nov 17, 2021 · 1 comment · Fixed by #2334
Closed
Labels
bug Something isn't working

Comments

@aaronslin
Copy link

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

I'm running Python 3.8.9 on OSX 11.3.1, but this shouldn't matter here.

Additional context
This is a similar issue to the one in opentelemetry-python-contrib; apologies in advance that my Python-packaging-fu is limited.

Direct references to pkg_resources are added outside of the build context here:

from pkg_resources import iter_entry_points

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 in setup.cfg's such as this one.

@aaronslin aaronslin added the bug Something isn't working label Nov 17, 2021
@ocelotl
Copy link
Contributor

ocelotl commented Nov 17, 2021

Yes, we should include it as a dependency, any package that is imported in any part of the src directory must be a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants