-
Notifications
You must be signed in to change notification settings - Fork 19
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 use of pkg_resources from osrf_pycommon. #66
Conversation
dd283f2
to
0f0a58d
Compare
@clalancette I'm going to do one more release for Python2 before doing this. |
b1a3cb9
to
826816a
Compare
Replace it with the use of the more modern importlib* libraries. There are a couple of reasons to do this: 1. pkg_resources is quite slow to import; on my machine, just firing up the python interpreter takes ~35ms, while firing up the python interpreter and importing pkg_resources takes ~175ms. Firing up the python interpreter and importing importlib_metadata takes ~70ms. Removing 100ms per invocation of the command-line both makes it speedier for users, and will speed up our tests (which call out to the command-line quite a lot). 2. pkg_resources is somewhat deprecated and being replaced by importlib. https://importlib-metadata.readthedocs.io/en/latest/using.html describes some of it Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: William Woodall <william@osrfoundation.org>
efb21b2
to
fd238ad
Compare
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
…data Signed-off-by: William Woodall <william@osrfoundation.org>
Signed-off-by: William Woodall <william@osrfoundation.org>
Update on this, I've released versions 1.0.2 supporting < focal and 2.0.0 supporting >= focal. I released both to pip, and both to our bootstrap repository, making the I was going to release them into the current ROS 2 distributions, but after talking to @nuclearsandwich about it we may want to change that and the latest previous version (1.0.1) is not in foxy or galactic anyway. I added this to the next ROS 2 meeting's agenda. |
I think this change introduced a regression on ROS 1 Noetic / Debian Buster, because there is no Python 3.8 package for that release, and hence the Can version 1.0.2 please be re-released for Buster? |
@rgov thanks for letting me know. I will look into this, sorry for the disruption. We did a split release which was supposed to avoid this (e.g. we have separate debs for Ubuntu |
I'm doing the release today. |
Thanks for reporting it! |
Replace it with the use of the more modern importlib*
libraries. There are a couple of reasons to do this:
pkg_resources is quite slow to import; on my machine,
just firing up the python interpreter takes ~35ms, while
firing up the python interpreter and importing pkg_resources
takes ~175ms. Firing up the python interpreter and importing
importlib_metadata takes ~70ms. Removing 100ms per invocation
of the command-line both makes it speedier for users, and
will speed up our tests (which call out to the command-line
quite a lot).
pkg_resources is somewhat deprecated and being replaced
by importlib. https://importlib-metadata.readthedocs.io/en/latest/using.html
describes some of it
Signed-off-by: Chris Lalancette clalancette@openrobotics.org
See ros2/ros2#919 for a lot more details on why we want to do this.