Skip to content

misc: use stdlib "importlib.metadata" on Python >= 3.12#5156

Open
herin049 wants to merge 2 commits intoopen-telemetry:mainfrom
herin049:feat/importlib-optional
Open

misc: use stdlib "importlib.metadata" on Python >= 3.12#5156
herin049 wants to merge 2 commits intoopen-telemetry:mainfrom
herin049:feat/importlib-optional

Conversation

@herin049
Copy link
Copy Markdown
Contributor

Description

Switches to using the standard library's importlib.metadata module for Python versions 3.12 and above, eliminating the importlib_metadata dependency for Python 3.12 and above.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk
uv run tox -e py310-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Documentation has been updated

@herin049 herin049 requested a review from a team as a code owner April 28, 2026 01:58
@herin049 herin049 changed the title misc: use stdlib on Python >= 3.12 misc: use stdlib "importlib.metadata" on Python >= 3.12 Apr 28, 2026
@herin049 herin049 moved this to Ready for review in Python PR digest Apr 28, 2026
@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Apr 28, 2026

We discussed this when we introduced the shim module and we decided for having the same library instead of having per python version behavior. It was a different time and now we support more version with stdlib support than not but I guess a topic for next SIG call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants