Skip to content

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

@aaronslin

Description

@aaronslin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions