From 6912c3963d7f7390bd25727093ce21491f9951fe Mon Sep 17 00:00:00 2001 From: Matt Oberle Date: Wed, 27 Oct 2021 18:53:10 -0400 Subject: [PATCH] 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 --- CHANGELOG.md | 2 ++ opentelemetry-instrumentation/setup.cfg | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index feb5441ef..d7fa3863b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/opentelemetry-instrumentation/setup.cfg b/opentelemetry-instrumentation/setup.cfg index 4c61cf0a6..57f7936b4 100644 --- a/opentelemetry-instrumentation/setup.cfg +++ b/opentelemetry-instrumentation/setup.cfg @@ -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]