[ros-release] Update on Python Support in Indigo

Tully Foote tfoote at osrfoundation.org
Tue Dec 31 00:38:13 UTC 2013


- For Indigo Igloo, ROS will continue to use Python 2.7 (an update to REP 3
is under review [1](https://github.com/ros-infrastructure/rep/pull/64)).
 In some future distro, we will switch to Python 3.

- We recommend that developers make their code Python 2/3 compatible [2](
http://wiki.ros.org/python_2_and_3_compatible_code) to allow for a future
transition to Python 3.

- We recommend that developers test their code with Python 3.3 from source
(to be supported in Indigo).

Long Form:

In preparing for Indigo we have ported most of the core ROS libraries and
tools to work with both Python 2 and Python 3.  This work is not difficult,
but it is time-consuming and it requires good tests to make sure that it’s
done correctly.  Because we don’t want to require everybody in the ROS
community to go through this process immediately, we are going to stick
with Python 2.7 for Indigo, instead of switching to Python 3, as we had
previously discussed.

We considered various approaches to supporting both Python 2 and Python 3
in Indigo and have determined that it would effectively mean forking the
distro and having two versions of Indigo, each containing a subset of the
overall list of packages.  A large part of the value of a ROS distribution
is that it specifies a common platform, with known versions of important
dependencies, upon which everybody can depend.  We don’t want to lose that
value by starting to split the ROS ecosystem into potentially incompatible

So we’re staying with Python 2 for Indigo, which means, among other things,
that: rosdep rules will continue to resolve to Python 2 packages and the
Ubuntu .debs will be built with dependencies on Python 2 packages.

Ubuntu has been very public about migrating the default desktop install
forward to use Python 3, but their progress has been slow, and they will
continue in Ubuntu Trusty to provide Python 2 packages in parallel with
Python 3 packages as recommended by PEP 394.  We expect that Python 2
support in Ubuntu will continue beyond Trusty, as Python 2 and Python 3 are
installable side by side and so much existing code works only with Python 2.

It will be necessary to migrate ROS forward to Python 3 at some point in
the future. As such, we highly recommend that, when you are working on a
package, make it Python 2 and Python 3 compatible. Here
http://wiki.ros.org/python_2_and_3_compatible_code is the list of common
fixes to make your code 2/3 compatible. If you find yourself working on
some Python code, go ahead and make it 2/3 compatible while you’re there.
 It’s not hard and the effort now will serve you well in the future.

If you have any questions or feedback please let us know.


Other related links:

https://github.com/ros/rosdistro/issues/2427 ROS Core Python 3 migration

https://wiki.ubuntu.com/Python/3 Ubuntu Python 3 Guide: No Python 2 by
default on Ubuntu 14.04 LTS

https://wiki.ubuntu.com/Python Generic Ubuntu Python Overview

http://www.python.org/dev/peps/pep-0394/ Python PEP: /usr/bin/python will
always be Python 2

core dependency burndown tracker: 9 out of 38 python3 supported
http://wiki.ros.org/python_2_and_3_compatible_code Guide to migrating
Python 2 code to be compatible with both Python 2 and Python 3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-release/attachments/20131230/19da194e/attachment-0001.html>

More information about the ros-release mailing list