-
Notifications
You must be signed in to change notification settings - Fork 16
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
pkg_resources
is deprecated
#119
Comments
@marcinwrochna Thanks for reporting this issue! Feel free to send a PR if you're interested :) |
Yeas that would be a nice and valuable contribution if you have a time to do it :) |
Sorry, this requires some understanding of all the requirements in lightning projects and of python packaging in general – I have neither, so I'll just say what I found by looking into it. Three files currently use pkg_resources. In all cases, they cannot be directly replaced with importlib, because there is no parse_requirements, Requirements, nor require() there. I believe the intention here is that one shouldn't try to reimplement distribution-package requirement checks outside of pip.
|
I found this quite calling as I would see two steps:
|
Other listed issues - Lightning-AI/pytorch-lightning#16756 |
Bug
src/lightning_utilities/core/imports.py
imports pkg_resources, which is deprecated (since at least 2020) in favor of importlib.resources, importlib.metadata, and their backports (importlib_resources, importlib_metadata). See here.To Reproduce
PYTHONWARNINGS=default::DeprecationWarning python -c 'import torchmetrics'
(or
import lightning_utilities
)The text was updated successfully, but these errors were encountered: