Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pkg_resources #32299

Closed
wants to merge 1 commit into from
Closed

Conversation

jeremydvoss
Copy link
Member

Description

Remove deprecated pkg_resources. Replace with importlib_metadata. Related PRs:
open-telemetry/opentelemetry-python#3167
open-telemetry/opentelemetry-python-contrib#1973

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@github-actions github-actions bot added the Monitor - Distro Monitor OpenTelemetry Distro label Sep 29, 2023
@jeremydvoss jeremydvoss force-pushed the importlib-metadata branch 2 times, most recently from 85a5879 to b574da7 Compare September 29, 2023 21:52
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@jeremydvoss jeremydvoss marked this pull request as ready for review October 2, 2023 21:08
@jeremydvoss jeremydvoss requested a review from lzchen as a code owner October 2, 2023 21:08
@jeremydvoss
Copy link
Member Author

Leave direct dependency

@jeremydvoss
Copy link
Member Author

Closing to stash warnings instead.
importlib_metadata has issues with azure sdk
importlib.metadata is >=py3.8
pkg_resources is deprecated

@jeremydvoss jeremydvoss closed this Oct 3, 2023
@jeremydvoss
Copy link
Member Author

jeremydvoss commented Oct 3, 2023

Looks like because we pass entry_point.dist to get_dist_dependency_conflicts, this would then cause an issue. The dist works differently for importlib_metadata:

TypeError
'list' object is not callable
Traceback (most recent call last):
  File "C:\Users\jeremyvoss\workplace\auto_instrumentation\lib\site-packages\azure\monitor\opentelemetry\_configure.py", line 163, in _setup_instrumentations
    conflict = get_dist_dependency_conflicts(entry_point.dist)
  File "C:\Users\jeremyvoss\workplace\auto_instrumentation\lib\site-packages\opentelemetry\instrumentation\dependencies.py", line 30, in get_dist_dependency_conflicts
    main_deps = dist.requires()
TypeError: 'list' object is not callable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Distro Monitor OpenTelemetry Distro
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants