Skip to content

Commit

Permalink
Add setuptools instrumentation install requirement
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattoberle committed Oct 26, 2021
1 parent dbc6a86 commit 39ae6e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.6.2-0.25b2...HEAD)
- `opentelemetry-instrumentation-aws-lambda` Add instrumentation for AWS Lambda Service - pkg metadata files (Part 1/2)
([#739](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/739))
- `opentelemetry-instrumentation` Add `setuptools` to `install_requires`
([#781](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/781))

### Fixed

Expand Down
1 change: 1 addition & 0 deletions opentelemetry-instrumentation/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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]
Expand Down

0 comments on commit 39ae6e2

Please sign in to comment.