Ask Your Question
0

rosdep *_python3 style rules

asked 2020-02-11 11:42:30 -0600

kyrofa gravatar image

The rosdep contribution guide points out:

You may see existing rules that use _python3-suffixed distribution codenames. These were trialed as a possible style of Python 3 rules and should not be used for newly added definitions.

I just ran into one, and I'm not sure how to utilize it. I'm talking about python-serial. There seems to be no way to get rosdep to resolve the python-serial key to the python3-serial Debian package. I'm running with ROS 2 Dashing on Ubuntu Bionic, and I've tried the following combinations:

$ rosdep resolve python-serial
#apt
python-serial
$ ROS_PYTHON_VERSION=3 rosdep resolve python-serial
#apt
python-serial
$ rosdep resolve python3-serial
ERROR: no rosdep rule for 'python3-serial'

_python3-suffixed rules sound deprecated, but at least in practice they actually appear dead. Is there a special way to use these of which I'm unaware, or should we be rewriting such rules to be python3-* top-level rules alongside the python-* ones, as is the now-established practice for new rules?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-02-11 11:53:24 -0600

marguedas gravatar image

Is there a special way to use these of which I'm unaware

The way to use those is to tell rosdep that your OS is "*_python3" e.g.

root@cdf6f1d3bd1c:/# rosdep resolve python-serial
#apt
python-serial
root@cdf6f1d3bd1c:/# rosdep resolve python-serial --os ubuntu:bionic_python3
#apt
python3-serial

should we be rewriting such rules to be python3-* top-level rules alongside the python-* ones, as is the now-established practice for new rules?

I believe yes, you would need to use a conditional dependency similarly to https://github.com/ros/ros/blob/ee546...

Note that you will also need to add a python3-serial key to the rosdep database as it doesn't currently exist

edit flag offensive delete link more

Comments

Oh wow, I didn't even think about trying a different os! In that case, I see no downside to adding the new rule as well. Thank you!

kyrofa gravatar imagekyrofa ( 2020-02-11 11:58:09 -0600 )edit

That approach is explicitly discouraged.

Dirk Thomas gravatar imageDirk Thomas ( 2020-02-11 12:52:41 -0600 )edit
1

answered 2020-02-11 12:59:44 -0600

Dirk Thomas gravatar image

These were trialed as a possible style of Python 3 rules and should not be used for newly added definitions.

You simply shouldn'y use these rules.

Instead your package should declare different conditional dependencies for Python 2 and Python 3. See http://wiki.ros.org/UsingPython3/Sour... for an example as well as http://wiki.ros.org/UsingPython3 for the high level documentation regarding the transition to Python 3 support.

edit flag offensive delete link more

Comments

You might consider adding such guidance to the rosdep contribution guide; it was unclear if I should go ahead with adding a top-level rule or figure out how to use the existing _python ones. The only thing that was clear was that I shouldn't be writing NEW _python ones.

kyrofa gravatar imagekyrofa ( 2020-02-13 10:41:16 -0600 )edit

Please consider to contribute a pull request if you would like the documentation to see improved.

Dirk Thomas gravatar imageDirk Thomas ( 2020-02-13 10:51:26 -0600 )edit
kyrofa gravatar imagekyrofa ( 2020-02-13 11:13:55 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-02-11 11:42:30 -0600

Seen: 25 times

Last updated: Feb 11