Skip to content

Replace deprecated package with warnings/typing_extensions deprecated #4467

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

Open
jenshnielsen opened this issue Mar 9, 2025 · 0 comments · May be fixed by #4522
Open

Replace deprecated package with warnings/typing_extensions deprecated #4467

jenshnielsen opened this issue Mar 9, 2025 · 0 comments · May be fixed by #4522

Comments

@jenshnielsen
Copy link
Contributor

Is your feature request related to a problem?

I was wondering if there is any interest in replacing deprecated decorator from the deprecated package with the one from the standard library (or typing_extensions for python <3.13).

This has two primary benefits.

  • It removes the dependency on deprecated and wrapt. Specially wrapt is a compiled dependency that may not be available for all python versions and platforms
  • Deprecation can be statically discovered by the type checker and highlighted in an editor e.g. vscode with show a deprecated call with a strike out.

If there is interest, I can submit a pr with the changes.

Describe the solution you'd like

Replace deprecated decorator with the one from typing_extensions / warnings.

This can either be dome by always using typing_extensions or using a conditional import and depend on typing_extensions for python <3.13

This would change the dependencies of opentelemtry_api from

deprecated
importlib-metadata
wrapt
zipp

to

typing_extensions
importlib-metadata
zipp

Describe alternatives you've considered

  • Continue as is:
    This has the negative implications of including heavier dependencies than needed specifically wrapt that is a compile d dependency that sometimes breaks for newer python versions and may not be available for all systems.

  • Remove all deprecated methods and functions and drop deprecated.
    Probably not realistic any time soon as there are many deprecated items

Additional Context

No response

Would you like to implement a fix?

Yes

@dimastbk dimastbk linked a pull request Apr 2, 2025 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant