From 54503c4ea10cb4f661fdfd2db1f6d4b1efa01e87 Mon Sep 17 00:00:00 2001 From: Matt Oberle Date: Wed, 15 Dec 2021 11:28:40 -0500 Subject: [PATCH 1/2] Add setuptools runtime requirement The `pkg_resources` module is provided by `setuptools`. The `setuptools` package is not part of the Python stdlib but is often available in the system environment as a build-time requirement. Explicitly listing `setuptools` as a requirement protects `opentelemetry-python` from breaking with import errors in cases where `setuptools` is not available system-wide. This commit pins the version to `setuptools >= 16.0` which is the first release that includes the required imports (2015). --- exporter/opentelemetry-exporter-opencensus/setup.cfg | 1 + opentelemetry-api/setup.cfg | 1 + opentelemetry-sdk/setup.cfg | 1 + 3 files changed, 3 insertions(+) diff --git a/exporter/opentelemetry-exporter-opencensus/setup.cfg b/exporter/opentelemetry-exporter-opencensus/setup.cfg index b9dcdbc8202..f770c1e74d9 100644 --- a/exporter/opentelemetry-exporter-opencensus/setup.cfg +++ b/exporter/opentelemetry-exporter-opencensus/setup.cfg @@ -46,6 +46,7 @@ install_requires = opentelemetry-api ~= 1.3 opentelemetry-sdk ~= 1.3 protobuf >= 3.13.0 + setuptools >= 16.0 [options.packages.find] where = src diff --git a/opentelemetry-api/setup.cfg b/opentelemetry-api/setup.cfg index 21ae69460b2..ba91efcc5a5 100644 --- a/opentelemetry-api/setup.cfg +++ b/opentelemetry-api/setup.cfg @@ -45,6 +45,7 @@ include_package_data = True install_requires = Deprecated >= 1.2.6 aiocontextvars; python_version<'3.7' + setuptools >= 16.0 [options.packages.find] where = src diff --git a/opentelemetry-sdk/setup.cfg b/opentelemetry-sdk/setup.cfg index e78448dd820..04d75fa5a3a 100644 --- a/opentelemetry-sdk/setup.cfg +++ b/opentelemetry-sdk/setup.cfg @@ -45,6 +45,7 @@ include_package_data = True install_requires = opentelemetry-api == 1.7.1 opentelemetry-semantic-conventions == 0.26b1 + setuptools >= 16.0 [options.packages.find] where = src From 7f6ab5b95622ecd49560d8ec7c8c15af85842628 Mon Sep 17 00:00:00 2001 From: Matt Oberle Date: Wed, 15 Dec 2021 12:18:32 -0500 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 052b02278af..12d6b01b0c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2307](https://github.com/open-telemetry/opentelemetry-python/pull/2307)) - Adding OTEL_LOGS_EXPORTER environment variable ([#2320](https://github.com/open-telemetry/opentelemetry-python/pull/2320)) +- Add `setuptools` to `install_requires` + ([#2334](https://github.com/open-telemetry/opentelemetry-python/pull/2334)) ## [1.7.1-0.26b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.7.0-0.26b0) - 2021-11-11