-
Notifications
You must be signed in to change notification settings - Fork 170
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
fix: pkg_resources deprecated warning #926
fix: pkg_resources deprecated warning #926
Conversation
Use importlib.metadata instead.
@cottsay I've added importlib_metadata for py3.6. Couple of questions:
|
@cottsay ping |
Good questions.
Should be safe to add
Yes, please do. Both |
@cottsay Couple of comments / questions (they'll be in their own pr if they need to be addressed)
|
Thanks for iterating.
I think it's good as-is. The setuptools version is useful here not because we're using setuptools (pkg_resources) to get the information, but because at the time, the packages used setuptools to build. While there are more options now and pip supports them, setuptools is still widely used and could be useful information debugging things.
These need to be separate changes for sure, and I think they should be made prior to merging this change so that we can point to the exact moment we dropped Python 2 support from rosdep. I've started this process in |
Ping me once it's merged, I'll fix merge conflicts. (if any) |
Can we add a simple test to exercise this code? Something like this could be added to def test_PipInstaller_get_version_strings():
from rosdep2.platforms.pip import PipInstaller
installer = PipInstaller()
assert installer.get_version_strings() |
@cottsay Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating
This pr fixes a warning caused by
pkg_resources
, by usingimportlib.metadata
instead.Importlib.metadata
is supported since py3.8, which is shipped with the oldest supported ROS1/2 distro (noetic, Ubuntu 20.04)Same warning in colcon (maybe resolved)