Add setuptools instrumentation install requirement (#781)

The `setuptools` package is not part of the stdlib, but often available
in the system environment (it is a buildtime requirement).

`pkg_resources` (a package provided by `setuptools`) is used as
a runtime requirement in `opentelemetry-instrumentation`. Explicitly
listing `setuptools` as a requirement protects instrumentation from
breaking with import errors in cases where `setuptools` is not available
system-wide.

For example:

* A multi-stage Docker build where the final image does not contain
buildtime requirements.
* A build system that packages the runtime dependencies into a single
binary.

This commit pins `setuptools >= 16.0` because that is the first release
that included all 5 imports instrumentation currently relies on.

Co-authored-by: Matt Oberle <mattoberle@users.noreply.github.com>
This commit is contained in:
Matt Oberle
2021-10-27 18:53:10 -04:00
committed by GitHub
parent 335a14c682
commit 6912c3963d
2 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#739](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/739))
- Add support for Python 3.10
([#742](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/742))
- `opentelemetry-instrumentation` Add `setuptools` to `install_requires`
([#781](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/781))
### Fixed

View File

@ -43,6 +43,7 @@ zip_safe = False
include_package_data = True
install_requires =
opentelemetry-api ~= 1.4
setuptools >= 16.0
wrapt >= 1.0.0, < 2.0.0
[options.packages.find]